3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Qualtrics { public $input; public function __construct($input) { $this->input = $input; } public function output(){ if($this->allowedFormat($this->input)) { echo $this->input; } else { echo 'Disallowed Characters'; } } private function multiply($factor){ $this->input *=factor; } private function allowedFormat($qString){ return preg_match("/^[a-z0-9:_/\-]+$/i", $qString); } } $qObject = new Quatrics("string of words"); $qObject ->output();

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.60.0110.00416.73
8.3.50.0110.00721.84
8.3.40.0000.01518.87
8.3.30.0080.00818.72
8.3.20.0000.00820.34
8.3.10.0060.00323.66
8.3.00.0090.00619.26
8.2.180.0130.00618.16
8.2.170.0070.00722.96
8.2.160.0150.00419.17
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00017.63
8.2.120.0070.00026.35
8.2.110.0090.00020.46
8.2.100.0040.00817.69
8.2.90.0040.00419.17
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0000.01017.90
8.2.50.0000.00818.07
8.2.40.0070.00019.41
8.2.30.0040.00420.50
8.2.20.0000.00817.68
8.2.10.0080.00018.11
8.2.00.0040.00418.05
8.1.280.0130.00325.92
8.1.270.0060.00323.79
8.1.260.0070.00728.09
8.1.250.0070.00028.09
8.1.240.0070.00323.61
8.1.230.0060.00620.77
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0000.00917.35
8.1.190.0000.00817.23
8.1.180.0000.00718.10
8.1.170.0040.00420.10
8.1.160.0040.00421.86
8.1.150.0070.00018.64
8.1.140.0080.00019.36
8.1.130.0000.00717.59
8.1.120.0000.00717.35
8.1.110.0080.00017.35
8.1.100.0040.00417.23
8.1.90.0070.00017.29
8.1.80.0000.00817.36
8.1.70.0030.00317.29
8.1.60.0000.00817.50
8.1.50.0040.00417.45
8.1.40.0040.00417.51
8.1.30.0060.00317.59
8.1.20.0030.00517.43
8.1.10.0030.00617.51
8.1.00.0070.00017.36
8.0.300.0080.00018.77
8.0.290.0000.00916.63
8.0.280.0000.00718.29
8.0.270.0000.00717.18
8.0.260.0000.00817.14
8.0.250.0040.00416.96
8.0.240.0030.00316.98
8.0.230.0000.00716.93
8.0.220.0020.00516.83
8.0.210.0030.00416.89
8.0.200.0060.00016.82
8.0.190.0050.00316.93
8.0.180.0040.00416.91
8.0.170.0040.00416.90
8.0.160.0000.00716.80
8.0.150.0000.00716.86
8.0.140.0000.00716.77
8.0.130.0030.00313.30
8.0.120.0040.00416.82
8.0.110.0040.00416.80
8.0.100.0040.00416.77
8.0.90.0000.00716.95
8.0.80.0030.01316.95
8.0.70.0040.00416.96
8.0.60.0000.00716.95
8.0.50.0000.00716.88
8.0.30.0070.01517.06
8.0.20.0070.01117.40
8.0.10.0020.00516.88
8.0.00.0110.00816.73
7.4.330.0020.00216.66
7.4.320.0000.00616.45
7.4.300.0000.00616.45
7.4.290.0060.00016.55
7.4.280.0000.00716.57
7.4.270.0000.00916.43
7.4.260.0040.00416.50
7.4.250.0060.00316.51
7.4.240.0030.00316.47
7.4.230.0030.00316.63
7.4.220.0120.00316.54
7.4.210.0060.01316.64
7.4.200.0000.00716.42
7.4.160.0000.01616.54
7.4.150.0170.00017.40
7.4.140.0100.01117.86
7.4.130.0100.00716.46
7.4.120.0110.00616.66
7.4.110.0090.00916.46
7.4.100.0070.01716.35
7.4.90.0140.00416.38
7.4.80.0030.01319.39
7.4.70.0140.00316.45
7.4.60.0070.01016.48
7.4.50.0030.01316.63
7.4.40.0060.01216.51
7.4.30.0130.01016.53
7.4.00.0040.01114.93
7.3.330.0030.00413.15
7.3.320.0030.00313.18
7.3.310.0030.00316.29
7.3.300.0030.00316.32
7.3.290.0050.01016.27
7.3.280.0110.00516.27
7.3.270.0100.00717.40
7.3.260.0170.00716.30
7.3.240.0050.01116.52
7.3.230.0060.01216.39
7.3.210.0090.01616.35
7.3.200.0080.01316.23
7.3.190.0040.01216.61
7.3.180.0100.00716.27
7.3.170.0140.00516.66
7.3.160.0090.01316.19
7.3.120.0070.00714.86
7.3.110.0030.01015.01
7.3.100.0000.00915.02
7.3.90.0040.01114.75
7.3.80.0030.01014.59
7.3.70.0060.00314.88
7.3.60.0030.00614.94
7.3.50.0030.00614.91
7.3.40.0090.00614.89
7.3.30.0030.00914.33
7.3.20.0070.00716.33
7.3.10.0090.00516.40
7.3.00.0050.01016.33
7.2.330.0080.01116.46
7.2.320.0130.00616.34
7.2.310.0140.00416.38
7.2.300.0130.00416.32
7.2.290.0100.01016.56
7.2.240.0120.00414.93
7.2.230.0090.00614.88
7.2.220.0090.00314.78
7.2.210.0110.00414.86
7.2.200.0070.00714.97
7.2.190.0060.00914.76
7.2.180.0090.00614.87
7.2.170.0060.01015.02
7.2.160.0000.01314.78
7.2.150.0070.00716.58
7.2.140.0030.01016.77
7.2.130.0030.01216.65
7.2.120.0110.00916.77
7.2.110.0090.00516.63
7.2.100.0080.01216.65
7.2.90.0070.00816.60
7.2.80.0100.00316.71
7.2.70.0070.00716.45
7.2.60.0040.00916.58
7.2.50.0070.00916.82
7.2.40.0030.01016.64
7.2.30.0080.00616.67
7.2.20.0030.00916.66
7.2.10.0050.00816.47
7.2.00.0050.01017.49
7.1.330.0030.01315.69
7.1.320.0100.00315.27
7.1.310.0110.00415.75
7.1.300.0100.00315.48
7.1.290.0000.01315.49
7.1.280.0070.01015.76
7.1.270.0040.01215.54
7.1.260.0040.00915.69
7.1.250.0080.01015.54
7.1.200.0060.00615.29
7.1.100.0000.01317.78
7.1.70.0040.00817.10
7.1.60.0100.01019.48
7.1.50.0090.00916.89
7.1.00.0100.07022.57
7.0.200.0290.00614.78
7.0.60.0130.03720.02
7.0.50.0030.07717.86
7.0.40.0070.09020.40
7.0.30.0270.05020.19
7.0.20.0270.07320.15
7.0.10.0100.05720.22
7.0.00.0130.04720.24
5.6.210.0130.06320.65
5.6.200.0000.07318.18
5.6.190.0100.05020.50
5.6.180.0400.06020.41
5.6.170.0230.05320.53
5.6.160.0070.06020.49
5.6.150.0030.04718.19
5.6.140.0100.07718.21
5.6.130.0000.05018.26
5.6.120.0100.04021.01
5.6.110.0070.09021.08
5.6.100.0000.04721.01
5.6.90.0070.04020.97
5.6.80.0100.03320.42
5.5.350.4100.03320.44
5.5.340.0070.08018.09
5.5.330.0130.04720.13
5.5.320.0570.06720.34
5.5.310.0200.04320.30
5.5.300.0100.07717.98
5.5.290.0030.09018.09
5.5.280.0100.08320.70
5.5.270.0030.08720.66
5.5.260.0100.08320.88
5.5.250.0070.08320.71
5.5.240.0200.07020.02

preferences:
48.43 ms | 401 KiB | 5 Q