3v4l.org

run code in 300+ PHP versions simultaneously
<?php $compare = array( '1.23 biz', '1.12 foobar', 'bat', 'asdf', ); /** * Compare on title. */ function title_compare($x, $y) { $pattern = '/^\d+\..*$/i'; if (preg_match($pattern, $x['title'])) { // this preg_match causes the warning. $x_float = floatval($x['title']); $y_ if (floatval($x['title']) == floatval($y['title'])) return 0; elseif (floatval($x['title']) < floatval($y['title'])) return -1; else return 1; } else { if ($x['title'] == $y['title']) return 0; elseif ($x['title'] < $y['title']) return -1; else return 1; } } var_dump($compare); var_dump(uasort($items, 'title_compare'));

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)
5.4.350.0110.03712.03
5.4.340.0040.04812.03
5.4.320.0060.05112.52
5.4.310.0060.05612.52
5.4.300.0090.04812.52
5.4.290.0120.06812.52
5.4.280.0120.07312.41
5.4.270.0070.03912.41
5.4.260.0100.05912.41
5.4.250.0030.04512.41
5.4.240.0080.03712.41
5.4.230.0060.03912.40
5.4.220.0050.03712.40
5.4.210.0060.03712.40
5.4.200.0160.03512.40
5.4.190.0100.03612.39
5.4.180.0120.03912.39
5.4.170.0090.03812.40
5.4.160.0040.03912.40
5.4.150.0050.04212.40
5.4.140.0060.03712.09
5.4.130.0140.02712.07
5.4.120.0060.04112.04
5.4.110.0090.03212.03
5.4.100.0060.03612.03
5.4.90.0070.05712.03
5.4.80.0070.04512.03
5.4.70.0100.03812.03
5.4.60.0110.03912.02
5.4.50.0050.04012.03
5.4.40.0050.04012.02
5.4.30.0040.03912.01
5.4.20.0070.03412.01
5.4.10.0080.04612.01
5.4.00.0070.04411.50
5.3.290.0080.03712.80
5.3.280.0060.03812.71
5.3.270.0070.03912.72
5.3.260.0100.03712.72
5.3.250.0070.03912.72
5.3.240.0060.04112.72
5.3.230.0100.03612.71
5.3.220.0090.04112.68
5.3.210.0080.04112.68
5.3.200.0090.03912.68
5.3.190.0090.03712.67
5.3.180.0080.03812.67
5.3.170.0100.04612.67
5.3.160.0080.03812.67
5.3.150.0100.04212.67
5.3.140.0070.04312.66
5.3.130.0080.03812.66
5.3.120.0100.03912.66
5.3.110.0050.04312.66
5.3.100.0060.03912.12
5.3.90.0050.04212.10
5.3.80.0110.03612.10
5.3.70.0090.03412.10
5.3.60.0050.03812.08
5.3.50.0040.03712.03
5.3.40.0060.04112.03
5.3.30.0050.04111.98
5.3.20.0080.03911.77
5.3.10.0040.04611.73
5.3.00.0060.03811.73
5.2.170.0050.0409.22
5.2.160.0060.0359.22
5.2.150.0040.0539.22
5.2.140.0030.0379.22
5.2.130.0060.0309.18
5.2.120.0070.0319.18
5.2.110.0060.0379.19
5.2.100.0070.0399.18
5.2.90.0060.0619.18
5.2.80.0080.0439.17
5.2.70.0100.0389.18
5.2.60.0060.0299.14
5.2.50.0020.0389.11
5.2.40.0050.0379.08
5.2.30.0050.0419.05
5.2.20.0050.0359.04
5.2.10.0060.0328.95
5.2.00.0070.0308.81
5.1.60.0080.0278.09
5.1.50.0070.0278.09
5.1.40.0050.0298.07
5.1.30.0080.0278.42
5.1.20.0060.0308.44
5.1.10.0050.0278.17
5.1.00.0080.0268.16
5.0.50.0050.0206.64
5.0.40.0070.0186.51
5.0.30.0030.0376.31
5.0.20.0040.0336.28
5.0.10.0010.0296.27
5.0.00.0060.0316.26
4.4.90.0060.0174.77
4.4.80.0070.0374.76
4.4.70.0080.0324.75
4.4.60.0110.0354.75
4.4.50.0090.0454.77
4.4.40.0040.0344.71
4.4.30.0060.0184.76
4.4.20.0100.0464.84
4.4.10.0050.0214.84
4.4.00.0040.0524.76
4.3.110.0050.0404.67
4.3.100.0070.0204.66
4.3.90.0050.0294.63
4.3.80.0060.0274.58
4.3.70.0030.0204.63
4.3.60.0040.0154.62
4.3.50.0020.0194.63
4.3.40.0030.0464.53
4.3.30.0150.0723.30
4.3.20.0020.0183.28
4.3.10.0040.0203.24
4.3.00.0170.0237.58

preferences:
144.87 ms | 1386 KiB | 7 Q