3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a; } class B extends A { public $b; } $a = new B(); $a->a = 0; $a->b = 1; $b = new B(); $b->a = 1; $b->b = 0; // This compare walks the properties_table in both objects directly, // resulting in ->a being compared first. // // Ref: https://github.com/php/php-src/blob/b151e17bdfca573e0205cc90dc710f89d77f03cf/Zend/zend_object_handlers.c#L1517 var_dump($a < $b); // print_r() (or several other potential actions) forces the properties HashTable to be materialized, // It's not the output of this that matters, so ignore it. print_r($a, true); // Now that one of the objects has a materialized HashTable, // we materialize the other and walk that instead. // However, ordering of properties in properties_info // is not (necessarily) the same as in the property slots. // // Ref: https://github.com/php/php-src/blob/b151e17bdfca573e0205cc90dc710f89d77f03cf/Zend/zend_object_handlers.c#L1569 // Ref: https://github.com/php/php-src/blob/b151e17bdfca573e0205cc90dc710f89d77f03cf/Zend/zend_object_handlers.c#L70 var_dump($a < $b);

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.40.0120.00618.71
8.3.30.0070.01118.63
8.3.20.0040.00419.05
8.3.10.0080.00023.53
8.3.00.0000.00823.64
8.2.170.0120.00922.96
8.2.160.0070.00720.40
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0060.00319.82
8.2.110.0030.00622.29
8.2.100.0120.00017.84
8.2.90.0040.00419.09
8.2.80.0050.00319.25
8.2.70.0000.00917.63
8.2.60.0000.00918.05
8.2.50.0050.00318.07
8.2.40.0000.00819.35
8.2.30.0000.00720.72
8.2.20.0000.00717.98
8.2.10.0050.00218.11
8.2.00.0040.00419.42
8.1.270.0060.00323.99
8.1.260.0080.01126.35
8.1.250.0040.00428.09
8.1.240.0060.00320.29
8.1.230.0080.00417.83
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0070.00317.48
8.1.190.0040.00417.00
8.1.180.0050.00318.10
8.1.170.0040.00417.62
8.1.160.0070.00018.82
8.1.150.0030.00618.92
8.1.140.0000.00719.04
8.1.130.0000.00819.01
8.1.120.0040.00417.50
8.1.110.0000.00717.40
8.1.100.0000.01117.36
8.1.90.0000.00717.48
8.1.80.0040.00417.34
8.1.70.0040.00417.36
8.1.60.0040.00417.55
8.1.50.0040.00417.52
8.1.40.0000.00817.41
8.1.30.0050.00317.48
8.1.20.0080.00317.66
8.1.10.0040.00417.46
8.1.00.0000.00817.33
8.0.300.0060.00318.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0020.00517.17
8.0.260.0000.00817.25
8.0.250.0030.00317.01
8.0.240.0040.00416.97
8.0.230.0040.00416.96
8.0.220.0000.00716.85
8.0.210.0070.00016.77
8.0.200.0040.00416.93
8.0.190.0070.00016.95
8.0.180.0000.00816.90
8.0.170.0000.00816.92
8.0.160.0070.00016.77
8.0.150.0030.00416.75
8.0.140.0030.00416.68
8.0.130.0050.00013.29
8.0.120.0000.00816.86
8.0.110.0040.00416.77
8.0.100.0070.00016.75
8.0.90.0000.00816.95
8.0.80.0110.00716.93
8.0.70.0030.00516.95
8.0.60.0040.00416.92
8.0.50.0040.00316.75
8.0.30.0120.00816.93
8.0.20.0140.00817.28
8.0.10.0070.01516.86
8.0.00.0130.00817.09
7.4.330.0000.00515.55
7.4.320.0030.00316.46
7.4.300.0000.00616.40
7.4.290.0000.00816.50
7.4.280.0060.00316.50
7.4.270.0070.00016.50
7.4.260.0070.00016.53
7.4.250.0070.00016.51
7.4.240.0000.00816.65
7.4.230.0060.00316.60
7.4.220.0040.00416.30
7.4.210.0070.00816.56
7.4.200.0000.00716.57
7.4.160.0100.00716.42
7.4.150.0090.00916.52
7.4.140.0110.00917.61
7.4.130.0090.01016.95
7.4.120.0130.00716.66
7.4.110.0090.00916.95
7.4.100.0080.01116.92
7.4.90.0110.00716.96
7.4.80.0110.00917.85
7.4.70.0120.00916.89
7.4.60.0080.01016.89
7.4.50.0130.00416.93
7.4.40.0070.01116.86
7.4.30.0120.01117.19
7.4.20.0140.00717.22
7.4.10.0110.00717.19
7.4.00.0070.01315.84
7.3.330.0030.00313.27
7.3.320.0050.00013.27
7.3.310.0070.00016.15
7.3.300.0040.00416.29
7.3.290.0070.00016.18
7.3.280.0070.01216.26
7.3.270.0070.01016.19
7.3.260.0070.01017.08
7.3.250.0090.00817.05
7.3.240.0090.01016.61
7.3.230.0120.00716.92
7.3.220.0050.01417.07
7.3.210.0090.00916.91
7.3.200.0090.01016.85
7.3.190.0110.00816.86
7.3.180.0090.01216.88
7.3.170.0120.00717.00
7.3.160.0120.00716.89
7.3.150.0140.00717.12
7.3.140.0090.01217.10
7.3.130.0110.00817.21
7.3.120.0080.00816.25
7.3.110.0090.01116.36
7.3.100.0070.00916.30
7.3.90.0080.00916.33
7.3.80.0080.00716.26
7.3.70.0070.00816.37
7.3.60.0100.00616.35
7.3.50.0090.00816.22
7.3.40.0070.01016.28
7.3.30.0070.01116.29
7.3.20.0330.01016.92
7.3.10.0170.00916.21
7.3.00.0230.01116.43
7.2.340.0170.00617.11
7.2.330.0100.00917.00
7.2.320.0110.00917.07
7.2.310.0110.01017.05
7.2.300.0130.00816.81
7.2.290.0110.00916.88
7.2.280.0110.01317.22
7.2.270.0120.00617.20
7.2.260.0150.00517.27
7.2.250.0050.01316.54
7.2.240.0120.00716.36
7.2.230.0070.01316.50
7.2.220.0100.00716.42
7.2.210.0120.00816.40
7.2.200.0110.00516.33
7.2.190.0120.00716.41
7.2.180.0090.00816.24
7.2.170.0100.00816.45
7.2.160.0080.01217.13
7.2.150.0200.00217.22
7.2.140.0150.00717.23
7.2.130.0290.00916.53
7.2.120.0290.00916.49
7.2.110.0260.00716.49
7.2.100.0310.00616.56
7.2.90.0260.00916.51
7.2.80.0470.00715.63
7.2.70.0490.00815.95
7.2.60.0670.00915.85
7.2.50.0340.01215.81
7.2.40.0340.00815.78
7.2.30.0460.00715.89
7.2.20.0490.00915.91
7.2.10.0480.00815.93
7.2.00.0460.00815.79
7.1.330.0080.00916.43
7.1.320.0040.01016.45
7.1.310.0130.00416.36
7.1.300.0110.00716.28
7.1.290.0050.01216.48
7.1.280.0060.01316.43
7.1.270.0130.00616.37
7.1.260.0110.01016.28
7.1.250.0300.01115.78
7.1.240.0350.00715.81
7.1.230.0380.00915.76
7.1.220.0380.01115.75
7.1.210.0320.00615.64
7.1.200.0420.00915.01
7.1.190.0520.01114.96
7.1.180.0370.00714.98
7.1.170.0400.01115.01
7.1.160.0440.00714.98
7.1.150.0520.00615.00
7.1.140.0500.00814.90
7.1.130.0490.00814.78
7.1.120.0510.00714.89
7.1.110.0450.00714.93
7.1.100.0480.00914.94
7.1.90.0480.00914.87
7.1.80.0420.00814.79
7.1.70.0430.00814.87
7.1.60.0530.00822.05
7.1.50.0520.00822.03
7.1.40.0590.01122.15
7.1.30.0420.01022.07
7.1.20.0540.01122.01
7.1.10.0510.00714.91
7.1.00.0260.01215.01
7.0.330.0280.00615.47
7.0.320.0180.00616.48
7.0.310.0140.00916.47
7.0.300.0150.00516.60
7.0.290.0140.00616.59
7.0.280.0170.00716.54
7.0.270.0140.01516.37
7.0.260.0180.01016.41
7.0.250.0180.00816.46
7.0.240.0190.00916.37
7.0.230.0200.00716.41
7.0.220.0140.01116.42
7.0.210.0210.00716.41
7.0.200.0150.01316.59
7.0.190.0180.00616.59
7.0.180.0170.01116.55
7.0.170.0200.00616.57
7.0.160.0190.01416.58
7.0.150.0180.01116.50
7.0.140.0350.00916.58
7.0.130.0270.00216.53
7.0.120.0230.00516.57
7.0.110.0250.00816.47
7.0.100.0190.01116.61
7.0.90.0150.01116.54
7.0.80.0180.01116.59
7.0.70.0150.01516.58
7.0.60.0180.01116.45
7.0.50.0180.00916.50
7.0.40.0160.01216.46
7.0.30.0140.01016.50
7.0.20.0220.00416.57
7.0.10.0230.00516.53
7.0.00.0160.01016.45
5.6.400.0270.00816.99
5.6.390.0200.00716.94
5.6.380.0140.00716.12
5.6.370.0190.01216.88
5.6.360.0100.01417.02
5.6.350.0170.00616.92
5.6.340.0160.01216.81
5.6.330.0100.01816.71
5.6.320.0140.01416.71
5.6.310.0150.01616.73
5.6.300.0190.01517.00
5.6.290.0210.01816.98
5.6.280.0240.01116.92
5.6.270.0170.01216.93
5.6.260.0190.01216.92
5.6.250.0150.01316.85
5.6.240.0140.01617.00
5.6.230.0140.01716.86
5.6.220.0180.01616.96
5.6.210.0210.00916.94
5.6.200.0120.01716.89
5.6.190.0230.00616.97
5.6.180.0220.00916.83
5.6.170.0240.01116.94
5.6.160.0200.00616.93
5.6.150.0180.00816.90
5.6.140.0210.00916.91
5.6.130.0270.00516.84
5.6.120.0210.00816.96
5.6.110.0130.01416.89
5.6.100.0140.01716.83
5.6.90.0180.01016.88
5.6.80.0190.00616.91
5.6.70.0160.00816.88
5.6.60.0190.01116.83
5.6.50.0150.01116.81
5.6.40.0180.01116.94
5.6.30.0180.00916.88
5.6.20.0130.01016.88
5.6.10.0130.01616.84
5.6.00.0140.01216.89
5.5.380.0280.00816.86
5.5.370.0230.01316.79
5.5.360.0300.00716.86
5.5.350.0250.01316.98
5.5.340.0270.01416.75
5.5.330.0270.00916.93
5.5.320.0210.01716.82
5.5.310.0310.00516.92
5.5.300.0250.00916.97
5.5.290.0220.01316.89
5.5.280.0220.01316.83
5.5.270.0270.01016.95
5.5.260.0250.01416.91
5.5.250.0190.01516.81
5.5.240.0220.01216.89
5.5.230.0230.00816.84
5.5.220.0190.01116.84
5.5.210.0160.01316.85
5.5.200.0170.01716.78
5.5.190.0190.01416.85
5.5.180.0170.01316.88
5.5.170.0230.00616.71
5.5.160.0180.01316.85
5.5.150.0210.00916.87
5.5.140.0250.00816.97
5.5.130.0210.01016.82
5.5.120.0240.01016.86
5.5.110.0150.01816.83
5.5.100.0200.01016.82
5.5.90.0210.00916.80
5.5.80.0150.02016.88
5.5.70.0240.00916.79
5.5.60.0230.00816.86
5.5.50.0180.01316.69
5.5.40.0260.00716.87
5.5.30.0220.01216.73
5.5.20.0210.01116.87
5.5.10.0180.01516.82
5.5.00.0190.01116.76
5.4.450.0160.00915.27
5.4.440.0160.01115.28
5.4.430.0140.01215.25
5.4.420.0180.00815.31
5.4.410.0160.00815.34
5.4.400.0170.00615.21
5.4.390.0200.00715.22
5.4.380.0160.00815.27
5.4.370.0160.01115.24
5.4.360.0180.00815.17
5.4.350.0190.00415.24
5.4.340.0170.01015.16
5.4.330.0200.00615.32
5.4.320.0110.01415.20
5.4.310.0190.00615.17
5.4.300.0170.00715.22
5.4.290.0200.00415.26
5.4.280.0130.01015.24
5.4.270.0180.00515.28
5.4.260.0180.00815.28
5.4.250.0120.01215.22
5.4.240.0160.00715.21
5.4.230.0160.00715.17
5.4.220.0140.00915.33
5.4.210.0240.00415.24
5.4.200.0180.00815.22
5.4.190.0190.00715.20
5.4.180.0100.01415.30
5.4.170.0140.01015.25
5.4.160.0110.00815.24
5.4.150.0140.00515.22
5.4.140.0150.00715.24
5.4.130.0130.01015.26
5.4.120.0160.00615.22
5.4.110.0180.00715.21
5.4.100.0130.01015.26
5.4.90.0150.01215.37
5.4.80.0170.00615.30
5.4.70.0170.00615.33
5.4.60.0130.01015.21
5.4.50.0150.01015.26
5.4.40.0130.01015.24
5.4.30.0140.00715.20
5.4.20.0160.00815.22
5.4.10.0140.01015.19
5.4.00.0120.01015.23
5.3.290.0140.01115.52
5.3.280.0180.00715.45
5.3.270.0190.00515.54
5.3.260.0150.00815.54
5.3.250.0220.00415.62
5.3.240.0180.00915.44
5.3.230.0200.00815.45
5.3.220.0130.01115.31
5.3.210.0110.01415.38
5.3.200.0130.01515.39
5.3.190.0180.01115.36
5.3.180.0110.01115.41
5.3.170.0130.01315.46
5.3.160.0130.01015.50
5.3.150.0170.00615.40
5.3.140.0220.00415.45
5.3.130.0200.00815.37
5.3.120.0180.00815.37
5.3.110.0180.00815.37
5.3.100.0130.00915.42
5.3.90.0110.01215.46
5.3.80.0130.00915.35
5.3.70.0140.00915.32
5.3.60.0090.01315.37
5.3.50.0160.00615.29
5.3.40.0190.00515.32
5.3.30.0160.00715.33
5.3.20.0130.01015.36
5.3.10.0120.01015.21
5.3.00.0200.00815.22
5.2.170.0100.00914.95
5.2.160.0110.00915.00
5.2.150.0090.01014.91
5.2.140.0100.00814.88
5.2.130.0120.00814.94
5.2.120.0140.00515.00
5.2.110.0100.01214.98
5.2.100.0120.01015.00
5.2.90.0130.00714.96
5.2.80.0150.01014.99
5.2.70.0130.00914.86
5.2.60.0130.00814.87
5.2.50.0120.01114.85
5.2.40.0130.00614.86
5.2.30.0120.01014.89
5.2.20.0140.00714.86
5.2.10.0120.00814.78
5.2.00.0140.00414.76
5.1.60.0140.00614.54
5.1.50.0150.00314.48
5.1.40.0130.00414.44
5.1.30.0110.00614.65
5.1.20.0150.00414.46
5.1.10.0160.00214.46
5.1.00.0110.00614.38
5.0.50.0110.00514.33
5.0.40.0070.00914.33
5.0.30.0060.00814.33
5.0.20.0120.00414.33
5.0.10.0070.00914.33
5.0.00.0140.00114.33
4.4.90.0080.00314.33
4.4.80.0080.00314.33
4.4.70.0080.00214.33
4.4.60.0070.00314.33
4.4.50.0030.00614.33
4.4.40.0060.00314.33
4.4.30.0050.00514.33
4.4.20.0060.00414.33
4.4.10.0060.00414.33
4.4.00.0080.00214.33
4.3.110.0070.00314.33
4.3.100.0050.00414.33
4.3.90.0050.00514.33
4.3.80.0090.00014.33
4.3.70.0020.00814.33
4.3.60.0080.00314.33
4.3.50.0040.00714.33
4.3.40.0060.00314.33
4.3.30.0050.00414.33
4.3.20.0030.00514.33
4.3.10.0070.00214.33
4.3.00.0040.00314.33

preferences:
61.48 ms | 400 KiB | 5 Q