3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $number = new \BcMath\Number(-1); $values = [ 0, '0.2', 0.2, new \BcMath\Number('0.2'), fopen('php://stdin', 'r'), new stdClass(), ]; $printBool = static fn (bool $b) => $b ? 'true' : 'false'; foreach ($values as $val) { printf("--------------\n%s\n--------------\n", print_r($val, true)); echo '<: ' . $printBool($number < $val) . "\n"; echo '<=: ' . $printBool($number <= $val) . "\n"; echo '>: ' . $printBool($number > $val) . "\n"; echo '>=: ' . $printBool($number >= $val) . "\n"; echo '==: ' . $printBool($number == $val) . "\n"; echo '!=: ' . $printBool($number != $val) . "\n"; echo '<=>: ' . ($number <=> $val) . "\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.5.00.0100.01120.25
8.4.150.0020.00114.05
8.4.140.0120.00917.61
8.4.130.0110.00917.76
8.4.120.0110.00620.80
8.4.110.0130.00722.26
8.4.100.0120.00918.02
8.4.90.0060.00317.90
8.4.80.0160.00517.81
8.4.70.0500.00917.78
8.4.60.0370.00917.80
8.4.50.0300.00717.85
8.4.40.0220.00317.48
8.4.30.0240.01317.80
8.4.20.0360.00817.80
8.4.10.0450.00617.58
8.3.280.0110.01118.51
8.3.270.0150.00516.60
8.3.260.0140.00716.50
8.3.250.0110.00819.09
8.3.240.0090.01016.50
8.3.230.0050.00416.78
8.3.220.0050.00316.56
8.3.210.0320.00616.49
8.3.200.0320.00616.69
8.3.190.0370.01016.48
8.3.180.0250.00416.59
8.3.170.0170.00416.37
8.3.160.0280.00816.50
8.3.150.0370.00916.26
8.3.140.0330.01016.56
8.3.130.0310.01016.36
8.3.120.0320.01016.42
8.3.110.0310.01116.43
8.3.100.0380.00916.47
8.3.90.0360.00916.38
8.3.80.0230.00616.83
8.3.70.0380.01116.65
8.3.60.0380.00916.41
8.3.50.0380.01016.27
8.3.40.0400.00617.73
8.3.30.0410.00917.56
8.3.20.0320.00717.45
8.3.10.0310.00717.46
8.3.00.0340.00717.77
8.2.290.0050.00322.13
8.2.280.0210.00916.96
8.2.270.0240.00716.56
8.2.260.0300.00916.51
8.2.250.0300.00916.49
8.2.240.0320.00716.64
8.2.230.0240.01216.50
8.2.220.0290.01516.38
8.2.210.0290.00616.64
8.2.200.0290.00416.46
8.2.190.0290.00716.67
8.2.180.0280.01116.67
8.2.170.0370.00317.65
8.2.160.0320.01017.48
8.2.150.0300.01117.58
8.2.140.0190.00617.50
8.2.130.0300.01117.26
8.2.120.0350.00717.52
8.2.110.0330.00917.34
8.2.100.0280.01217.55
8.2.90.0270.00617.68
8.2.80.0180.00217.47
8.2.70.0230.00817.41
8.2.60.0340.00717.33
8.2.50.0400.00817.28
8.2.40.0370.00917.34
8.2.30.0430.00717.55
8.2.20.0260.00517.44
8.2.10.0220.00417.32
8.2.00.0280.00917.64

preferences:
32.98 ms | 403 KiB | 5 Q