3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "foobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisout"; $b = str_repeat("a", 300); echo "Static Var\n"; testCopy($a); echo "Dynamic Var\n"; testCopy($b); $c = $a . "test"; echo memory_get_usage() . "\n"; function testCopy($var) { echo memory_get_usage() . "\n"; $var = (string) $var; echo memory_get_usage() . "\n"; }
Output for 7.0.0 - 7.1.0
Static Var 348688 348688 Dynamic Var 348688 348688 349712
Output for 5.6.0 - 5.6.28
Static Var 220040 220088 Dynamic Var 220040 220408 221072
Output for 5.5.0 - 5.5.35
Static Var 220024 220072 Dynamic Var 220024 220392 221056
Output for 5.4.0 - 5.4.45
Static Var 220544 220592 Dynamic Var 220544 220912 221576
Output for 5.3.11 - 5.3.29
Static Var 625208 626144 Dynamic Var 625208 625576 626248
Output for 5.3.0 - 5.3.10
Static Var 624904 625840 Dynamic Var 624904 625272 625944
Output for 5.2.10 - 5.2.17
Static Var 83152 84080 Dynamic Var 83152 83512 84088
Output for 5.2.7 - 5.2.9
Static Var 83752 84736 Dynamic Var 83848 84168 85064
Output for 5.2.3 - 5.2.6
Static Var 84072 85056 Dynamic Var 84168 84488 85384
Output for 5.2.2
Static Var 81968 82952 Dynamic Var 82064 82384 83280
Output for 5.2.1
Static Var 82016 82904 Dynamic Var 82056 82376 82952
Output for 5.0.0 - 5.2.0
Static Var <br /> <b>Fatal error</b>: Call to undefined function memory_get_usage() in <b>/in/dprNi</b> on line <b>13</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Static Var <br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/dprNi</b> on line <b>13</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Static Var <br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/dprNi</b> on line <b>13</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Static Var <br /> <b>Fatal error</b>: Call to undefined function: memory_get_usage() in <b>/in/dprNi</b> on line <b>13</b><br />