3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static $prop = 'A'; } class Child extends Base { } // both values are A $excepted = 'A'; echo "Should be $excepted and is " . Base::$prop . "\n"; echo "Should be $excepted and is " . Child::$prop . "\n"; // both values are B $excepted = 'B'; Base::$prop = $expected; echo "Should be $excepted and is " . Base::$prop . "\n"; echo "Should be $excepted and is " . Child::$prop . "\n"; // VALUES DIFFER $expected = 'C'; $property = new ReflectionProperty('Base', 'prop'); $property->setValue($excepted); echo "Should be $excepted and is " . Base::$prop . "\n"; echo "Should be $excepted and is " . Child::$prop . "\n"; // VALUES STILL DIFFER $excepted = 'D'; Base::$prop = $expected; echo "Should be $excepted and is " . Base::$prop . "\n"; echo "Should be $excepted and is " . Child::$prop . "\n";

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)
8.3.60.0070.01516.88
8.3.50.0090.00921.10
8.3.40.0150.00018.72
8.3.30.0120.00318.64
8.3.20.0040.01120.39
8.3.10.0080.00021.89
8.3.00.0040.00419.54
8.2.180.0070.01018.54
8.2.170.0090.00622.96
8.2.160.0100.01020.37
8.2.150.0030.00524.18
8.2.140.0090.00924.66
8.2.130.0030.00526.16
8.2.120.0090.00017.75
8.2.110.0080.00322.08
8.2.100.0100.00317.63
8.2.90.0000.00918.99
8.2.80.0000.00817.97
8.2.70.0050.00317.50
8.2.60.0070.00317.80
8.2.50.0060.00318.07
8.2.40.0040.00421.07
8.2.30.0000.00719.72
8.2.20.0080.00017.66
8.2.10.0000.00818.27
8.2.00.0040.00418.03
8.1.280.0140.00725.92
8.1.270.0090.00920.29
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0070.00322.46
8.1.230.0100.00317.42
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0090.00017.25
8.1.190.0040.00417.23
8.1.180.0040.00418.10
8.1.170.0090.00018.50
8.1.160.0040.00422.01
8.1.150.0030.00518.97
8.1.140.0000.00817.36
8.1.130.0030.00317.80
8.1.120.0040.00417.54
8.1.110.0080.00017.42
8.1.100.0080.00017.53
8.1.90.0050.00217.54
8.1.80.0000.00717.55
8.1.70.0030.00517.36
8.1.60.0090.00017.52
8.1.50.0060.00317.46
8.1.40.0030.00517.54
8.1.30.0000.00817.59
8.1.20.0020.00517.58
8.1.10.0040.00417.59
8.1.00.0000.00817.54
8.0.300.0000.00818.77
8.0.290.0000.00916.75
8.0.280.0030.00318.47
8.0.270.0030.00317.26
8.0.260.0030.00317.29
8.0.250.0040.00417.01
8.0.240.0070.00017.06
8.0.230.0070.00017.06
8.0.220.0040.00416.88
8.0.210.0030.00616.93
8.0.200.0000.00616.88
8.0.190.0030.00617.07
8.0.180.0050.00316.99
8.0.170.0030.00517.02
8.0.160.0050.00217.01
8.0.150.0040.00416.93
8.0.140.0030.00516.99
8.0.130.0050.00313.42
8.0.120.0050.00316.85
8.0.110.0060.00316.99
8.0.100.0000.00816.98
8.0.90.0000.00816.84
8.0.80.0130.00316.99
8.0.70.0000.00717.03
8.0.60.0030.00317.04
8.0.50.0040.00417.05
8.0.30.0100.00817.08
8.0.20.0100.00917.40
8.0.10.0070.00017.08
8.0.00.0100.00716.73
7.4.330.0030.00315.08
7.4.320.0000.00716.52
7.4.300.0030.00316.54
7.4.290.0000.00716.53
7.4.280.0050.00316.67
7.4.270.0000.00816.61
7.4.260.0070.00016.54
7.4.250.0080.00016.60
7.4.240.0040.00416.55
7.4.230.0000.00816.37
7.4.220.0040.01416.38
7.4.210.0090.00916.58
7.4.200.0070.00016.49
7.4.160.0090.01216.41
7.4.150.0070.01417.40
7.4.140.0080.01117.86
7.4.130.0100.00916.39
7.4.120.0050.01216.63
7.4.110.0100.00716.67
7.4.100.0090.00916.73
7.4.90.0110.00516.60
7.4.80.0090.00919.39
7.4.70.0130.00316.53
7.4.60.0060.01116.60
7.4.50.0040.00416.34
7.4.40.0090.00916.62
7.4.30.0190.00316.38
7.4.00.0070.00914.66
7.3.330.0030.00313.41
7.3.320.0000.00513.26
7.3.310.0000.00716.41
7.3.300.0070.00016.37
7.3.290.0120.00516.41
7.3.280.0140.00316.42
7.3.270.0060.01117.40
7.3.260.0090.00916.64
7.3.250.0140.00616.54
7.3.240.0090.00916.64
7.3.230.0090.00816.64
7.3.210.0100.01016.39
7.3.200.0100.00716.51
7.3.190.0070.01016.43
7.3.180.0070.01016.61
7.3.170.0160.00616.57
7.3.160.0060.01116.49
7.3.120.0070.01314.98
7.3.110.0030.01514.98
7.3.100.0060.00615.05
7.3.90.0030.01214.96
7.3.80.0040.01114.82
7.3.70.0040.00814.91
7.3.60.0030.01314.95
7.3.50.0060.01314.95
7.3.40.0060.01014.74
7.3.30.0070.00414.98
7.3.20.0090.00316.36
7.3.10.0070.00716.50
7.3.00.0030.00916.48
7.2.330.0060.01216.48
7.2.320.0070.01016.68
7.2.310.0100.00916.55
7.2.300.0130.01216.26
7.2.290.0130.00916.81
7.2.250.0060.01214.78
7.2.240.0030.01315.29
7.2.230.0040.01115.13
7.2.220.0080.00414.99
7.2.210.0030.01315.32
7.2.200.0070.00715.09
7.2.190.0000.01715.07
7.2.180.0100.00615.11
7.2.170.0070.01015.11
7.2.60.0030.01016.89
7.2.00.0070.00719.51
7.1.330.0070.00715.70
7.1.320.0070.00715.50
7.1.310.0000.00915.83
7.1.300.0060.00915.46
7.1.290.0030.00815.82
7.1.280.0060.01215.99
7.1.270.0000.01515.76
7.1.260.0030.01316.02
7.1.200.0090.00315.88
7.1.100.0070.00718.30
7.1.70.0040.01117.12
7.1.60.0120.01220.03
7.1.50.0070.01816.85
7.1.00.0070.07322.54
7.0.200.0000.01115.05
7.0.60.0000.05320.04
7.0.50.0170.03317.86
7.0.40.0130.06020.02
7.0.30.0470.07320.20
7.0.20.0370.07020.15
7.0.10.0100.08020.07
7.0.00.0100.05320.08
5.6.210.0070.07320.64
5.6.200.0070.08718.18
5.6.190.0130.06020.33
5.6.180.0270.04020.39
5.6.170.0330.07320.45
5.6.160.0100.08020.50
5.6.150.0170.07718.29
5.6.140.0070.05018.13
5.6.130.0030.08718.17
5.6.120.0130.08321.02
5.6.110.0100.08020.98
5.6.100.0270.07021.15
5.6.90.0100.06321.04
5.6.80.0030.04720.41
5.6.70.4870.02720.45
5.5.350.0070.08020.40
5.5.340.0030.04017.97
5.5.330.0030.04320.18
5.5.320.0470.06720.24
5.5.310.0230.04320.35
5.5.300.0100.07017.95
5.5.290.0100.05717.95
5.5.280.0200.06320.91
5.5.270.0070.06720.91
5.5.260.0070.07720.89
5.5.250.0000.08320.48
5.5.240.0070.07020.30
5.4.450.0270.04319.34
5.4.440.0130.06019.70
5.4.430.0170.05319.30
5.4.420.0130.05319.61
5.4.410.0200.06719.48
5.4.400.0230.04719.01
5.4.390.0330.05719.28
5.4.380.0470.04719.16
5.4.370.0100.05319.14
5.4.360.0130.05719.29
5.4.350.0230.04319.14
5.4.340.0130.06019.15
5.4.320.0300.05018.87
5.4.310.0270.04019.26
5.4.300.0200.04319.01
5.4.290.0300.04319.14
5.4.280.0030.06719.06
5.4.270.0200.05019.16
5.4.260.0070.06019.30
5.4.250.0170.05318.88
5.4.240.0170.04718.97
5.4.230.0070.05319.14
5.4.220.0300.05019.15
5.4.210.0300.05019.11
5.4.200.0130.04719.12
5.4.190.0170.06019.05
5.4.180.0130.05319.13
5.4.170.0100.05319.27
5.4.160.0100.05319.29
5.4.150.0270.05719.09
5.4.140.0430.04316.44
5.4.130.0170.06316.37
5.4.120.0100.05716.60
5.4.110.0200.04716.58
5.4.100.0100.05016.68
5.4.90.0030.05716.56
5.4.80.0130.04316.56
5.4.70.0200.04016.49
5.4.60.0230.06716.43
5.4.50.0070.04316.39
5.4.40.0070.03716.52
5.4.30.0000.07016.23
5.4.20.0270.06716.55

preferences:
29.2 ms | 401 KiB | 5 Q