3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; } } class MyCloneable { public $object1; public $object2; } /* class MyCloneable { public function __invoke($object1,$object2) { $this->oject1=$object1; $this->oject2=$object2; } }*/ $obj = new MyCloneable(); $obj->object1 = new SubObject(); $obj->object2 = new SubObject(); while ( $obj!== NULL ){ $obj2=new $obj->object1; $obj2=new $obj->object2; } endwhile; print("Oggetto originale:\n"); print_r($obj); print("Oggetto originale:\n"); print_r($obj2); ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.190.0160.04512.40
5.4.180.0310.08712.39
5.4.170.0350.08512.41
5.4.160.0170.04312.40
5.4.150.0290.09312.39
5.4.140.0240.09412.09
5.4.130.0320.08712.07
5.4.120.0360.08212.03
5.4.110.0140.04512.02
5.4.100.0350.08412.02
5.4.90.0360.08412.03
5.4.80.0390.08312.02
5.4.70.0220.10312.02
5.4.60.0350.08712.02
5.4.50.0400.07812.02
5.4.40.0180.04012.01
5.4.30.0670.04212.01
5.4.20.0300.08812.00
5.4.10.0380.08312.01
5.4.00.0150.04211.50
5.3.270.0160.04612.72
5.3.260.0240.04412.72
5.3.250.0210.04412.72
5.3.240.0510.10312.72
5.3.230.0360.08912.71
5.3.220.0420.08312.68
5.3.210.0450.10812.68
5.3.200.0210.04012.68
5.3.190.0280.09812.67
5.3.180.0180.04812.67
5.3.170.0410.08812.67
5.3.160.0310.09212.67
5.3.150.0370.08412.67
5.3.140.0480.07712.66
5.3.130.0320.09212.66
5.3.120.0340.09112.66
5.3.110.0160.04512.66
5.3.100.0310.08912.13
5.3.90.0310.08712.11
5.3.80.0270.09412.09
5.3.70.0380.08512.09
5.3.60.0250.09612.07
5.3.50.0320.08812.02
5.3.40.0170.04312.02
5.3.30.0380.10912.00
5.3.20.0170.04111.77
5.3.10.0100.04511.73
5.3.00.0180.03911.71

preferences:
141.51 ms | 1386 KiB | 7 Q