3v4l.org

run code in 300+ PHP versions simultaneously
```php <?php $convertQ = function ($str) { switch ($str) { case 0: return 'no'; case 'No': return 'no'; case 1: return 'yes'; case 'Yes': return 'yes'; case 'Unsure': return 'maybe'; default: throw new \InvalidArgumentException('Unaccounted for value for questionnaire field: ' . $str); } }; var_dump($convertQ(0)); var_dump($convertQ('No')); var_dump($convertQ(1)); var_dump($convertQ('Yes')); var_dump($convertQ('Unsure')); var_dump($convertQ('a')); ```

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.6.120.0100.05320.99
5.6.110.0030.05721.14
5.6.100.0070.04320.98
5.6.90.0100.06320.95
5.6.80.0070.07720.51
5.6.70.4330.04020.53
5.5.280.0000.04720.81
5.5.270.0030.07720.73
5.5.260.0070.08020.87
5.5.250.0070.07020.55
5.5.240.0030.07720.26
5.4.440.0700.05319.31
5.4.430.0670.05719.46
5.4.420.0700.06319.17
5.4.410.0730.04719.18
5.4.400.0770.05319.17
5.4.390.0530.06018.99
5.4.380.0630.05018.84
5.4.370.0570.05719.10
5.4.360.0630.05019.25
5.4.350.0670.04719.09
5.4.340.0600.05719.11
5.4.320.0600.06019.14
5.4.310.0700.05019.11
5.4.300.0700.04718.94
5.4.290.0770.05019.09
5.4.280.0670.06718.95
5.4.270.0770.05719.20
5.4.260.0730.05319.21
5.4.250.0670.05719.00
5.4.240.0770.05319.21
5.4.230.0670.06019.09
5.4.220.0800.05019.08
5.4.210.0800.05018.89
5.4.200.0770.04716.74
5.4.190.0730.05318.84
5.4.180.0730.06019.01
5.4.170.0800.05319.13
5.4.160.0800.05018.84
5.4.150.0770.05019.16
5.4.140.0630.06316.68
5.4.130.0830.04716.64
5.4.120.0770.04716.54
5.4.110.0900.05716.25
5.4.100.0700.06016.48
5.4.90.0670.05716.28
5.4.80.0770.04716.47
5.4.70.0730.05316.58
5.4.60.0800.06016.54
5.4.50.0730.05716.25
5.4.40.0670.06716.54
5.4.30.0700.04716.42
5.4.20.0530.05716.31
5.4.10.0830.05316.28
5.4.00.0730.05315.89
5.3.290.0730.06014.89
5.3.280.0800.04714.82
5.3.270.0770.05314.72
5.3.260.0100.05314.60
5.3.250.0100.05314.79
5.3.240.0100.05014.60
5.3.230.0700.06014.52
5.3.220.0730.06014.62
5.3.210.0770.05314.74
5.3.200.0800.04714.58
5.3.190.0830.04314.68
5.3.180.0630.06314.74
5.3.170.0870.06714.77
5.3.160.0830.05314.64
5.3.150.0800.04314.49
5.3.140.0670.04014.47
5.3.130.0870.05714.54
5.3.120.0700.05314.62
5.3.110.0570.06314.51
5.3.100.0330.05014.18
5.3.90.0000.06714.20
5.3.80.0400.06014.09
5.3.70.0530.05314.19
5.3.60.0630.05713.89
5.3.50.0330.05713.93
5.3.40.0130.04713.91
5.3.30.0200.04313.98
5.3.20.0530.04713.74
5.3.10.0430.05013.70
5.3.00.0330.04013.52
5.2.170.0670.04310.93
5.2.160.0600.03711.15
5.2.150.0530.05011.04
5.2.140.0500.04311.05
5.2.130.0530.04311.02
5.2.120.0500.04311.14
5.2.110.0430.04311.18
5.2.100.0300.04011.02
5.2.90.0470.02710.94
5.2.80.0400.04711.01
5.2.70.0600.04311.01
5.2.60.0600.04310.95
5.2.50.0600.03711.06
5.2.40.0530.04010.93
5.2.30.0500.03710.83
5.2.20.0500.03010.80
5.2.10.0570.04710.75
5.2.00.0370.04710.70
5.1.60.0530.0339.97
5.1.50.0630.0379.91
5.1.40.0370.04310.05
5.1.30.0670.03310.29
5.1.20.0470.03710.38
5.1.10.0530.0409.95
5.1.00.0530.0379.96
5.0.50.0330.0308.46
5.0.40.0300.0278.45
5.0.30.0330.0438.14
5.0.20.0270.0338.08
5.0.10.0100.0338.08
5.0.00.0330.0438.00
4.4.90.0300.0235.80
4.4.80.0300.0235.80
4.4.70.0130.0275.83
4.4.60.0100.0275.80
4.4.50.0270.0235.75
4.4.40.0270.0305.75
4.4.30.0200.0205.89
4.4.20.0300.0205.80
4.4.10.0270.0305.92
4.4.00.0200.0405.84
4.3.110.0230.0205.77
4.3.100.0230.0235.67
4.3.90.0170.0235.83
4.3.80.0270.0335.76
4.3.70.0200.0235.80
4.3.60.0200.0275.78
4.3.50.0300.0205.80
4.3.40.0130.0405.60
4.3.30.0170.0204.55
4.3.20.0070.0234.51
4.3.10.0100.0304.38
4.3.00.0070.0177.14

preferences:
144.12 ms | 1394 KiB | 7 Q