note 70348 deleted from language.types.string by bobby

From: Date: Thu, 12 Oct 2006 16:36:24 +0000
Subject: note 70348 deleted from language.types.string by bobby
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-118462@lists.php.net to get a copy of this message
Note Submitter: bogdan -AT- moongate -DOT- ro ---- Here's a nice one: <? $foo='test'; for($i=0;$i<10;$i++) { $bar="one$foo"; echo memory_get_usage()."\n"; } ?> Depending on your PHP configuration, you end up with the same value many times -- in my case, 12480 12488 12488 12488 12488 12488 12488 12488 12488 12488 Now, consider this example: <? $foo='test'; for($i=0;$i<10;$i++) { $bar="another$foo"; // <-- the only change is here echo memory_get_usage()."\n"; } ?> The result in this case, on my server, is: 12416 12432 12448 12464 12480 12496 12512 12528 12544 12560 On my server, I have PHP 4.3.11 (cgi) (built: Nov 8 2005 06:24:40) -- but I expect it's not the only version with this problem.

« previous php.notes (#118462) next »