3v4l.org

run code in 200+ PHP versions simultaneously
<?php class A { public $state = 1; } class B { public $a; public function __construct() { $this->a = $GLOBALS['a']; } } $GLOBALS['a'] = new A(); $b = new B(); echo $b->a->state . PHP_EOL; $GLOBALS['a']->state++; echo $b->a->state . PHP_EOL; $GLOBALS['a'] = new A(); echo $b->a->state . PHP_EOL;
based on l6ai9

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)
7.4.10.0040.01415.09
7.4.00.0060.00815.00
7.3.130.0140.00315.08
7.3.120.0110.00714.94
7.3.110.0060.01315.06
7.3.100.0090.00614.84
7.3.90.0000.01414.77
7.3.80.0000.01414.84
7.3.70.0050.00515.00
7.3.60.0040.00814.88
7.3.50.0000.00814.90
7.3.40.0030.01214.79
7.3.30.0060.00614.68
7.3.20.0030.01316.37
7.3.10.0090.00316.21
7.3.00.0060.00916.83
7.2.260.0070.01014.90
7.2.250.0030.01415.37
7.2.240.0060.00914.82
7.2.230.0070.00715.02
7.2.220.0000.01315.03
7.2.210.0030.01015.08
7.2.200.0060.00315.12
7.2.190.0100.00614.98
7.2.180.0060.00315.25
7.2.170.0040.01115.12
7.2.160.0080.00815.16
7.2.150.0030.01316.98
7.2.140.0030.01016.84
7.2.130.0040.00717.04
7.2.120.0030.01516.98
7.2.110.0050.00817.11
7.2.100.0040.01417.13
7.2.90.0060.00916.88
7.2.80.0070.00717.00
7.2.70.0060.01016.79
7.2.60.0100.00616.95
7.2.50.0040.01116.77
7.2.40.0070.00716.84
7.2.30.0060.00916.90
7.2.20.0040.01416.90
7.2.10.0060.00916.63
7.2.00.0040.01216.68
7.1.330.0140.00015.68
7.1.320.0030.01015.79
7.1.310.0100.00315.94
7.1.300.0040.00415.70
7.1.290.0060.00915.91
7.1.280.0090.00915.70
7.1.270.0000.01515.83
7.1.260.0100.00716.01
7.1.250.0060.00915.78
7.1.240.0140.00315.64
7.1.230.0100.00615.85
7.1.220.0000.01215.72
7.1.210.0030.01215.84
7.1.200.0070.00615.76
7.1.190.0080.00515.88
7.1.180.0030.00915.93
7.1.170.0000.01415.59
7.1.160.0060.00615.82
7.1.150.0110.00415.77
7.1.140.0000.00915.69
7.1.130.0030.01115.75
7.1.120.0030.01315.90
7.1.110.0070.00315.91
7.1.100.0040.00715.80
7.1.90.0030.00915.66
7.1.80.0040.01215.89
7.1.70.0020.00916.48
7.1.60.0110.00516.21
7.1.50.0060.00615.82
7.1.40.0040.00715.87
7.1.30.0060.00315.69
7.1.20.0060.00915.79
7.1.10.0120.00315.80
7.1.00.0070.03819.08
7.0.330.0060.00615.20
7.0.320.0110.00415.46
7.0.310.0100.00315.46
7.0.300.0000.01215.59
7.0.290.0050.01315.43
7.0.280.0110.00315.14
7.0.270.0000.01315.22
7.0.260.0030.00615.43
7.0.250.0000.01515.61
7.0.240.0040.00815.34
7.0.230.0040.00715.26
7.0.220.0000.01115.42
7.0.210.0030.01115.55
7.0.200.0130.00515.03
7.0.190.0060.00915.60
7.0.180.0030.01015.22
7.0.170.0070.00415.38
7.0.160.0060.00615.48
7.0.150.0030.01015.18
7.0.140.0030.01015.18
7.0.130.0040.01115.50
7.0.120.0030.01015.66
7.0.110.0070.04717.81
7.0.100.0100.04517.78
7.0.90.0180.02617.70
7.0.80.0040.04317.76
7.0.70.0120.04117.64
7.0.60.0090.03817.70
7.0.50.0130.02717.91
7.0.40.0120.03516.78
7.0.30.0090.03716.84
7.0.20.0130.03716.78
7.0.10.0030.04816.63
7.0.00.0080.03516.90
5.6.400.0070.00314.24
5.6.390.0090.00914.30
5.6.380.0060.00814.65
5.6.370.0110.00714.57
5.6.360.0080.00814.71
5.6.350.0070.01014.41
5.6.340.0000.01214.57
5.6.330.0070.00714.45
5.6.320.0060.00314.86
5.6.310.0040.01214.18
5.6.300.0060.00614.21
5.6.290.0000.00914.41
5.6.280.0030.00614.65
5.6.270.0070.00414.68
5.6.260.0030.01014.74
5.6.250.0050.04317.55
5.6.240.0070.04617.66
5.6.230.0130.03317.62
5.6.220.0080.04917.61
5.6.210.0050.04417.59
5.6.200.0120.03517.61
5.6.190.0060.02417.71
5.6.180.0030.03617.64
5.6.170.0050.04617.74
5.6.160.0050.03817.70
5.6.150.0080.04517.89
5.6.140.0080.03517.55
5.6.130.0030.04117.79
5.6.120.0130.03517.88
5.6.110.0150.03317.72
5.6.100.0060.04617.69
5.6.90.0020.04517.74
5.6.80.0030.04917.43
5.6.70.0080.04417.42
5.6.60.0080.03817.41
5.6.50.0090.04417.57
5.6.40.0100.03817.53
5.6.30.0090.04017.47
5.6.20.0080.04217.31
5.6.10.0070.03717.43
5.6.00.0110.03617.53