3v4l.org

run code in 300+ PHP versions simultaneously
<?php $baseMemory = memory_get_usage(); $array = array(); function test() { global $array; $array['test'] = 4; } echo sprintf( '%8d: ', $i ), memory_get_usage() - $baseMemory, "\n";
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.24, 7.3.0 - 7.3.12
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 32
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 88
Output for 5.6.0 - 5.6.28
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 408
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 392
Output for 5.3.0 - 5.3.29
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 496
Output for 5.2.10 - 5.2.17
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 480
Output for 5.2.3 - 5.2.9
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 944
Output for 5.2.2
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 912
Output for 5.2.1
Notice: Undefined variable: i in /in/YZm1K on line 11 0: 1008
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/YZm1K on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/YZm1K on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/YZm1K on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/YZm1K on line 2

preferences:
185.39 ms | 401 KiB | 264 Q