note 69099 added to function.system

From: Date: Wed, 23 Aug 2006 02:07:50 +0000
Subject: note 69099 added to function.system
Groups: php.notes 
Request: Send a blank email to php-notes+get-116190@lists.php.net to get a copy of this message
RE: Bill at KilgallonFamily dot com. I can see your problem. This is working as expected. You're using $resultStatus for both of the different types of results you can obtain here (last line of program output or the Int status). As we exec from right to left, the Int $resultStatus is being being over-written with the String output of the program. Your code: <?php $resultStatus = system('/bin/ls /foo', $resultStatus); print "$resultStatus"; ?> Should be: <?php $resultStatus = system('/bin/ls /foo', $intStatus); print "$intStatus"; ?> or can also be: <?php system('/bin/ls /foo', $resultStatus); print "$resultStatus"; ?> ---- Server IP: 203.16.234.90 Probable Submitter: 124.177.85.73 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.system.php Edit -- https://master.php.net/note/edit/69099 Del: integrated -- https://master.php.net/note/delete/69099/integrated Del: useless -- https://master.php.net/note/delete/69099/useless Del: bad code -- https://master.php.net/note/delete/69099/bad+code Del: spam -- https://master.php.net/note/delete/69099/spam Del: non-english -- https://master.php.net/note/delete/69099/non-english Del: in docs -- https://master.php.net/note/delete/69099/in+docs Del: other reasons-- https://master.php.net/note/delete/69099 Reject -- https://master.php.net/note/reject/69099 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116190) next »