3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { var $boo; function Foo() { $this->boo = md5('foo'); } function go() { echo $this->boo . PHP_EOL; } } $a = new Foo(); $a->go(); var_dump(memory_get_peak_usage());
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
int(425864)
Output for 8.1.0 - 8.1.28
int(426168)
Output for 8.0.0 - 8.0.30
int(426008)
Output for 7.4.0 - 7.4.33
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/Jsqk6 on line 3 acbd18db4cc2f85cedef654fccc4a4d8 int(426184)
Output for 7.3.32 - 7.3.33
acbd18db4cc2f85cedef654fccc4a4d8 int(426152)
Output for 7.3.0 - 7.3.31
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/Jsqk6 on line 3 acbd18db4cc2f85cedef654fccc4a4d8 int(426152)
Output for 7.2.0 - 7.2.33
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/Jsqk6 on line 3 acbd18db4cc2f85cedef654fccc4a4d8 int(422080)
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/Jsqk6 on line 3 acbd18db4cc2f85cedef654fccc4a4d8 int(385024)
Output for 5.6.0 - 5.6.40
acbd18db4cc2f85cedef654fccc4a4d8 int(228408)
Output for 5.5.0 - 5.5.38
acbd18db4cc2f85cedef654fccc4a4d8 int(228400)
Output for 5.4.0 - 5.4.45
acbd18db4cc2f85cedef654fccc4a4d8 int(228264)
Output for 5.3.11 - 5.3.29
acbd18db4cc2f85cedef654fccc4a4d8 int(636976)
Output for 5.3.0 - 5.3.10
acbd18db4cc2f85cedef654fccc4a4d8 int(636672)
Output for 5.2.10 - 5.2.17
acbd18db4cc2f85cedef654fccc4a4d8 int(94504)
Output for 5.2.7 - 5.2.9
acbd18db4cc2f85cedef654fccc4a4d8 int(94584)
Output for 5.2.3 - 5.2.6
acbd18db4cc2f85cedef654fccc4a4d8 int(94904)
Output for 5.2.2
acbd18db4cc2f85cedef654fccc4a4d8 int(92616)
Output for 5.2.1
acbd18db4cc2f85cedef654fccc4a4d8 int(92560)
Output for 5.1.3 - 5.1.6, 5.2.0
acbd18db4cc2f85cedef654fccc4a4d8 Fatal error: Call to undefined function memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 5.0.2 - 5.0.5, 5.1.0 - 5.1.2
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/Jsqk6 on line 5 acbd18db4cc2f85cedef654fccc4a4d8 Fatal error: Call to undefined function memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Strict Standards: var: Deprecated. Please use the public/private/protected modifiers in /in/Jsqk6 on line 5 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Jsqk6 on line 14 acbd18db4cc2f85cedef654fccc4a4d8PHP_EOL Fatal error: Call to undefined function memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 4.4.5 - 4.4.9
acbd18db4cc2f85cedef654fccc4a4d8 Fatal error: Call to undefined function: memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 4.3.10 - 4.3.11, 4.4.0 - 4.4.4
acbd18db4cc2f85cedef654fccc4a4d8 Fatal error: Call to undefined function: memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 4.3.2 - 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Jsqk6 on line 14 acbd18db4cc2f85cedef654fccc4a4d8PHP_EOL Fatal error: Call to undefined function: memory_get_peak_usage() in /in/Jsqk6 on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/Jsqk6 on line 14 acbd18db4cc2f85cedef654fccc4a4d8PHP_EOL Fatal error: Call to undefined function: memory_get_peak_usage() in /in/Jsqk6 on line 21

preferences:
328.37 ms | 402 KiB | 460 Q