3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class CanBeStrung { public function __toString(): string { return 'I\'m highly strung'; } } function isItStringy($possibleStringType): bool { if (is_string($possibleStringType)) { return true; } if(is_callable([$possibleStringType, '__toString'])) { return true; } return false; } assert(isItStringy('a string') === true); assert(isItStringy(new CanBeStrung()) === true); assert(isItStringy(42) === false); assert(isItStringy(new stdClass()) === false);

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.4.20.0140.00719.80
8.4.10.0040.00419.54
8.3.150.0180.00317.26
8.3.140.0050.00316.73
8.3.130.0080.00016.62
8.3.120.0090.00920.72
8.3.110.0060.00316.45
8.3.100.0090.00616.62
8.3.90.0130.00426.77
8.3.80.0000.00916.75
8.3.70.0160.00616.58
8.3.60.0070.01518.30
8.3.50.0130.00524.45
8.3.40.0070.00718.59
8.3.30.0090.00618.84
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.270.0060.01217.16
8.2.260.0060.00317.17
8.2.250.0040.00418.67
8.2.240.0060.00317.05
8.2.230.0000.00920.94
8.2.220.0030.00637.54
8.2.210.0100.00326.77
8.2.200.0040.00416.38
8.2.190.0100.00716.58
8.2.180.0150.00625.92
8.2.170.0110.00418.95
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0000.00724.66
8.2.130.0070.00026.16
8.2.120.0040.00419.83
8.2.110.0060.00320.78
8.2.100.0070.00417.84
8.2.90.0000.00919.51
8.2.80.0000.00817.97
8.2.70.0040.00417.92
8.2.60.0030.00517.77
8.2.50.0030.00518.10
8.2.40.0030.00519.34
8.2.30.0000.00719.18
8.2.20.0040.00418.11
8.2.10.0070.00019.23
8.2.00.0040.00419.20
8.1.310.0030.00516.76
8.1.300.0100.00015.98
8.1.290.0090.00030.84
8.1.280.0030.01325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.01
8.1.230.0080.00320.85
8.1.220.0000.00817.74
8.1.210.0000.00819.02
8.1.200.0000.00917.23
8.1.190.0040.00417.10
8.1.180.0060.00318.10
8.1.170.0080.00018.50
8.1.160.0000.00819.00
8.1.150.0000.00718.84
8.1.140.0000.00818.84
8.1.130.0030.00520.07
8.1.120.0000.00817.40
8.1.110.0000.00717.44
8.1.100.0030.00617.39
8.1.90.0000.00817.37
8.1.80.0000.00717.31
8.1.70.0030.00317.40
8.1.60.0040.00417.61
8.1.50.0050.00317.38
8.1.40.0000.00817.50
8.1.30.0040.00417.53
8.1.20.0060.00317.53
8.1.10.0060.00317.54
8.1.00.0040.00817.46
8.0.300.0050.00219.60
8.0.290.0070.00016.75
8.0.280.0030.00318.36
8.0.270.0030.00316.82
8.0.260.0070.00018.42
8.0.250.0030.00516.98
8.0.240.0030.00316.95
8.0.230.0030.00316.86
8.0.220.0000.00716.87
8.0.210.0030.00316.89
8.0.200.0000.00716.98
8.0.190.0000.00716.88
8.0.180.0050.00317.00
8.0.170.0040.00416.96
8.0.160.0070.00016.90
8.0.150.0070.00016.83
8.0.140.0040.00416.87
8.0.130.0030.00313.43
8.0.120.0040.00416.87
8.0.110.0030.00516.81
8.0.100.0030.00316.78
8.0.90.0000.00716.79
8.0.80.0040.01016.88
8.0.70.0110.00316.94
8.0.60.0030.00916.87
8.0.50.0060.00516.82
8.0.30.0050.01016.95
8.0.20.0070.01116.96
8.0.10.0070.00717.06
8.0.00.0110.00216.81
7.4.330.0050.00015.55
7.4.320.0000.00716.54
7.4.300.0060.00016.41
7.4.290.0040.00416.48
7.4.280.0000.00716.55
7.4.270.0030.00316.38
7.4.260.0000.00513.18
7.4.250.0040.00416.43
7.4.240.0030.00516.59
7.4.230.0070.00016.46
7.4.220.0010.00616.48
7.4.210.0050.01016.50
7.4.200.0060.00616.43
7.4.190.0050.00716.46
7.4.180.0070.00516.60
7.4.160.0070.00516.56
7.4.150.0080.00316.50
7.4.140.0070.00316.44
7.4.130.0080.00716.45
7.4.120.0090.00616.29
7.4.110.0080.00816.46
7.4.100.0030.01016.47
7.4.90.0010.01216.41
7.4.80.0030.01217.40
7.4.70.0060.00616.35
7.4.60.0040.01016.43
7.4.50.0080.00716.46
7.4.40.0090.00616.33
7.4.30.0070.00616.47
7.4.20.0070.00716.52
7.4.10.0070.00616.47
7.4.00.0060.00716.45
7.3.330.0040.00416.27
7.3.320.0060.00013.37
7.3.310.0000.00716.50
7.3.300.0000.00716.21
7.3.290.0070.00616.37
7.3.280.0090.00316.36
7.3.270.0100.00216.33
7.3.260.0070.00816.38
7.3.250.0030.00816.29
7.3.240.0030.00816.36
7.3.230.0060.00716.40
7.3.220.0030.00716.32
7.3.210.0070.00716.42
7.3.200.0060.00616.43
7.3.190.0050.00716.31
7.3.180.0080.00716.41
7.3.170.0050.00816.39
7.3.160.0050.00916.35
7.3.150.0080.00616.42
7.3.140.0090.00616.36
7.3.130.0040.00916.29
7.3.120.0060.00816.33
7.3.110.0070.00716.19
7.3.100.0050.00716.33
7.3.90.0090.00516.52
7.3.80.0080.00816.29
7.3.70.0080.00516.38
7.3.60.0050.00916.50
7.3.50.0090.00516.48
7.3.40.0070.00816.47
7.3.30.0080.00716.46
7.3.20.0070.00916.50
7.3.10.0060.00816.46
7.3.00.0090.00516.44
7.2.340.0090.00716.25
7.2.330.0110.00616.45
7.2.320.0110.00916.36
7.2.310.0130.00616.44
7.2.300.0130.00616.46
7.2.290.0130.00716.34
7.2.280.0150.00416.32
7.2.270.0110.01016.29
7.2.260.0120.00816.29
7.2.250.0160.00616.41
7.2.240.0110.00916.43
7.2.230.0120.00716.34
7.2.220.0110.00716.36
7.2.210.0130.00616.45
7.2.200.0130.01116.51
7.2.190.0090.01116.40
7.2.180.0100.01216.39
7.2.170.0100.01016.50
7.2.160.0100.00916.54
7.2.150.0180.00816.56
7.2.140.0130.01016.51
7.2.130.0150.00616.62
7.2.120.0110.01016.65
7.2.110.0110.00816.53
7.2.100.0080.01116.54
7.2.90.0090.00916.51
7.2.80.0090.01216.58
7.2.70.0110.00916.56
7.2.60.0140.00716.54
7.2.50.0110.00916.40
7.2.40.0140.00816.70
7.2.30.0140.00616.58
7.2.20.0090.00816.63
7.2.10.0130.00716.55
7.2.00.0170.00616.58

preferences:
69.45 ms | 403 KiB | 5 Q