3v4l.org

run code in 300+ PHP versions simultaneously
<?php // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $vmDir = '/var/spool/asterisk/voicemail/especial'; $idCustomer = $_SESSION['user_data']['id']; $vmCustomer = $vmDir . '/' . $idCustomer; $req = $_REQUEST['c']; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if(in_array($req, array('get', 'del'))) { switch($req) { /** * Ruta para listar mensajes de voz */ case 'get_list': $newVmList = $oldVmList = array(); $response = array(); $index = 0; /* nuevos mensajes de voz */ chdir($vmCustomer . '/INBOX'); array_multisort(array_map('filemtime', ($newVmList = glob("*.txt"))), SORT_DESC, $newVmList); /* archivo mensajes de voz */ chdir($vmCustomer . '/Old'); array_multisort(array_map('filemtime', ($oldVmList = glob("*.txt"))), SORT_DESC, $oldVmList); foreach($newVmList as $file) { $response[$index] = parseVmInfoFile($file, true); $response[$index]['new'] = true; $index++; } foreach($oldVmList as $file) { $response[$index] = parseVmInfoFile($file, false); $response[$index]['new'] = false; $index++; } echo json_encode($response); break; /** * Ruta que se ejecuta para recuperar el fichero de audio * del mensaje y mover los mensajes nuevos al directorio * de archivo */ case 'play': $vmInfo = $_GET['vm_info']; $wavFile = $vmCustomer . '/' . ($new ? 'INBOX' : 'Old') . '/' . basename($vmInfo['file'], '.txt') . '.wav'; $fh = fopen($wavFile, 'rb'); header("Content-Type: audio/wav"); header("Content-Length: " . filesize($wavFile)); fpassthru($fh); break; /** * Ruta para eliminar un mensaje de voz */ case 'del': $vmInfo = $_GET['vm_info']; $txtFile = $vmCustomer . '/' . ($new ? 'INBOX' : 'Old') . '/' . $vmInfo['file']; $wavFile = $vmCustomer . '/' . ($new ? 'INBOX' : 'Old') . '/' . basename($vmInfo['file'], '.txt') . '.wav'; unlink($txtFile); unlink($wavFile); break; } } /** * Parsea la informaciĆ³n contenida en el fichero de txt * asociado al mensaje de voz * * @param string $file Nombre del fichero * @param boolean $new Nuevo mensaje de voz (true) o de * archivo * @return array */ function parseVmInfoFile($file, $new) { $path = $vmCustomer . '/' . ($new ? 'INBOX' : 'Old'); $vmInfo = parse_ini_file($path . '/' . $file); return array( 'callerid' => $vmInfo['callerid'], 'date' => new \DateTime($vmInfo['origdate']), 'duration' => (int)$vmInfo['duration'], 'file' => $file ); }

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.00418.56
8.3.50.0110.00822.05
8.3.40.0130.01319.02
8.3.30.0120.00319.04
8.3.20.0000.00820.26
8.3.10.0080.00021.89
8.3.00.0000.00918.04
8.2.180.0090.00918.63
8.2.170.0040.01122.96
8.2.160.0130.00619.09
8.2.150.0050.00324.18
8.2.140.0000.00724.66
8.2.130.0070.01126.16
8.2.120.0050.00321.02
8.2.110.0080.00322.16
8.2.100.0040.00817.91
8.2.90.0080.00019.36
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0020.00518.23
8.2.20.0040.00417.84
8.2.10.0070.00018.27
8.2.00.0050.00317.74
8.1.280.0070.01125.92
8.1.270.0060.00623.82
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0080.00023.91
8.1.230.0080.00819.01
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.25
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0000.00818.50
8.1.160.0040.00422.02
8.1.150.0000.00718.80
8.1.140.0030.00517.49
8.1.130.0030.00317.86
8.1.120.0000.00717.45
8.1.110.0060.00317.45
8.1.100.0040.00417.50
8.1.90.0040.00417.43
8.1.80.0000.00717.52
8.1.70.0000.00717.38
8.1.60.0080.00017.64
8.1.50.0060.00317.44
8.1.40.0000.00817.48
8.1.30.0080.00017.71
8.1.20.0080.00017.66
8.1.10.0040.00417.60
8.1.00.0050.00217.52
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0080.00018.52
8.0.270.0050.00217.19
8.0.260.0000.00617.36
8.0.250.0000.00716.95
8.0.240.0000.00717.04
8.0.230.0000.00717.05
8.0.220.0040.00416.96
8.0.210.0050.00316.92
8.0.200.0030.00316.95
8.0.190.0040.00417.06
8.0.180.0000.00817.05
8.0.170.0000.00717.00
8.0.160.0000.00817.05
8.0.150.0000.00816.91
8.0.140.0040.00416.98
8.0.130.0000.00613.41
8.0.120.0070.00214.58
8.0.110.0050.00414.58
8.0.100.0040.00414.58
8.0.90.0060.00214.52
8.0.80.0060.00514.64
8.0.70.0060.00414.61
8.0.60.0090.00114.53
8.0.50.0050.00614.54
8.0.30.0090.00815.29
8.0.20.0060.01015.44
8.0.10.0070.00414.61
8.0.00.0070.00615.20
7.4.330.0000.00515.20
7.4.320.0000.00716.49
7.4.300.0000.00616.64
7.4.290.0030.00616.60
7.4.280.0000.00716.52
7.4.270.0000.00716.55
7.4.260.0100.00016.58
7.4.250.0070.00614.35
7.4.240.0040.00614.98
7.4.230.0050.00514.40
7.4.220.0090.00514.41
7.4.210.0060.00714.43
7.4.200.0030.00714.38
7.4.190.0020.01013.36
7.4.180.0090.00413.32
7.4.160.0070.00614.43
7.4.150.0090.00414.63
7.4.140.0110.00515.55
7.4.130.0080.00714.92
7.4.120.0120.00314.88
7.4.110.0060.00814.28
7.4.100.0080.00514.42
7.4.90.0080.00614.35
7.4.80.0050.00815.29
7.4.70.0080.00614.33
7.4.60.0090.00614.32
7.4.50.0030.00614.23
7.4.40.0090.00414.40
7.4.30.0080.00714.32
7.4.20.0100.00113.23
7.4.10.0070.00713.85
7.4.00.0080.00614.12
7.3.330.0030.00313.27
7.3.320.0030.00313.33
7.3.310.0060.00514.34
7.3.300.0050.00514.28
7.3.290.0090.00514.28
7.3.280.0090.00615.16
7.3.270.0120.00314.59
7.3.260.0120.00314.38
7.3.250.0110.00414.85
7.3.240.0070.00714.34
7.3.230.0080.00714.36
7.3.220.0090.00413.29
7.3.210.0090.00514.29
7.3.200.0070.00615.31
7.3.190.0070.00914.43
7.3.180.0110.00214.32
7.3.170.0110.00314.35
7.3.160.0060.00714.30
7.3.150.0080.00513.33
7.3.140.0110.00013.26
7.3.130.0050.00813.77
7.3.120.0080.00614.01
7.3.110.0060.00813.65
7.3.100.0050.00713.73
7.3.90.0070.00513.90
7.3.80.0080.00413.81
7.3.70.0070.00413.87
7.3.60.0050.00413.99
7.3.50.0070.00613.82
7.3.40.0060.00613.83
7.3.30.0040.00413.78
7.3.20.0060.00315.64
7.3.10.0060.00415.56
7.3.00.0020.00715.63
7.2.340.0100.00213.28
7.2.330.0090.00614.23
7.2.320.0110.00314.31
7.2.310.0080.00714.33
7.2.300.0090.00514.47
7.2.290.0100.00414.29
7.2.280.0070.00513.18
7.2.270.0090.00413.13
7.2.260.0090.00413.77
7.2.250.0070.00713.91
7.2.240.0070.00513.86
7.2.230.0070.00613.80
7.2.220.0120.00013.81
7.2.210.0060.00613.76
7.2.200.0110.00213.98
7.2.190.0090.00313.83
7.2.180.0080.00613.85
7.2.170.0050.00614.01
7.2.160.0060.00613.96
7.2.150.0100.00515.74
7.2.140.0080.00615.66
7.2.130.0070.00615.81
7.2.120.0090.00415.87
7.2.110.0090.00415.78
7.2.100.0080.00515.81
7.2.90.0070.00715.70
7.2.80.0090.00515.71
7.2.70.0080.00615.73
7.2.60.0110.00315.73
7.2.50.0060.00615.74
7.2.40.0060.00715.60
7.2.30.0090.00415.84
7.2.20.0060.00915.84
7.2.10.0090.00515.82
7.2.00.0100.00316.57
7.1.330.0090.00314.83
7.1.320.0070.00414.76
7.1.310.0090.00314.79
7.1.300.0080.00414.87
7.1.290.0060.00714.70
7.1.280.0090.00214.77
7.1.270.0060.00614.73
7.1.260.0090.00514.77
7.1.250.0050.00614.71
7.1.240.0040.00814.79
7.1.230.0080.00514.84
7.1.220.0070.00714.69
7.1.210.0070.00514.83
7.1.200.0080.00414.87
7.1.190.0090.00414.79
7.1.180.0050.00814.76
7.1.170.0090.00314.67
7.1.160.0100.00414.73
7.1.150.0070.00614.81
7.1.140.0110.00114.68
7.1.130.0100.00314.79
7.1.120.0080.00514.75
7.1.110.0090.00514.76
7.1.100.0090.00415.65
7.1.90.0080.00514.73
7.1.80.0110.00114.85
7.1.70.0050.00615.29
7.1.60.0080.00715.95
7.1.50.0110.00615.26
7.1.40.0090.00614.87
7.1.30.0080.00514.81
7.1.20.0080.00514.79
7.1.10.0100.00214.84
7.1.00.0070.02216.64
7.0.330.0090.00414.53
7.0.320.0090.00414.49
7.0.310.0060.00614.35
7.0.300.0090.00314.46
7.0.290.0080.00314.53
7.0.280.0020.00914.48
7.0.270.0090.00314.60
7.0.260.0050.00714.42
7.0.250.0070.00514.65
7.0.240.0090.00514.68
7.0.230.0110.00214.53
7.0.220.0070.00614.43
7.0.210.0070.00514.64
7.0.200.0070.00615.04
7.0.190.0050.00614.58
7.0.180.0070.00614.53
7.0.170.0070.00414.63
7.0.160.0110.00214.53
7.0.150.0080.00414.41
7.0.140.0070.02116.41
7.0.130.0100.00214.66
7.0.120.0090.00314.68
7.0.110.0090.00214.56
7.0.100.0080.00414.43
7.0.90.0170.02315.87
7.0.80.0210.02315.77
7.0.70.0200.01515.86
7.0.60.0210.01215.85
7.0.50.0240.02316.00
7.0.40.0080.02215.39
7.0.30.0070.01815.49
7.0.20.0090.01915.44
7.0.10.0100.01315.52
7.0.00.0070.02115.41
5.6.400.0070.00513.40
5.6.390.0060.00613.32
5.6.380.0070.00513.39
5.6.370.0080.00413.25
5.6.360.0060.00713.21
5.6.350.0110.00313.13
5.6.340.0050.00513.36
5.6.330.0060.00613.37
5.6.320.0080.00413.37
5.6.310.0080.00413.17
5.6.300.0070.00613.19
5.6.290.0050.00713.19
5.6.280.0080.02015.05
5.6.270.0070.00613.38
5.6.260.0050.00713.36
5.6.250.0090.00413.17
5.6.240.0050.02615.08
5.6.230.0090.02415.05
5.6.220.0040.02615.22
5.6.210.0080.01915.06
5.6.200.0050.02715.37
5.6.190.0090.02515.42
5.6.180.0080.02415.18
5.6.170.0080.01715.24
5.6.160.0070.02415.25
5.6.150.0060.01715.26
5.6.140.0100.02215.29
5.6.130.0070.01715.29
5.6.120.0100.02415.46
5.6.110.0070.02515.22
5.6.100.0060.02715.26
5.6.90.0060.02415.22
5.6.80.0100.02214.99
5.6.70.0090.01715.08
5.6.60.0090.02115.14
5.6.50.0070.02414.99
5.6.40.0090.02214.97
5.6.30.0070.01415.05
5.6.20.0060.01415.09
5.6.10.0090.02215.11
5.6.00.0070.01515.02
5.5.380.0080.02215.04
5.5.370.0080.02215.08
5.5.360.0070.01515.00
5.5.350.0110.01814.98
5.5.340.0080.02215.06
5.5.330.0050.02315.18
5.5.320.0070.01815.21
5.5.310.0090.02215.10
5.5.300.0080.02115.13
5.5.290.0100.01715.16
5.5.280.0090.02515.13
5.5.270.0080.02215.20
5.5.260.0070.02315.12
5.5.250.0080.02515.01
5.5.240.0080.02314.92
5.5.230.0080.01714.99
5.5.220.0080.02214.95
5.5.210.0070.02314.86
5.5.200.0080.01414.94
5.5.190.0070.01214.77
5.5.180.0050.01614.91
5.5.170.0080.00712.96
5.5.160.0040.02114.97
5.5.150.0050.01714.91
5.5.140.0100.01214.71
5.5.130.0080.01214.78
5.5.120.0080.01714.83
5.5.110.0060.01414.87
5.5.100.0060.02214.99
5.5.90.0070.01415.01
5.5.80.0050.02215.05
5.5.70.0080.01114.90
5.5.60.0050.01314.85
5.5.50.0030.01614.93
5.5.40.0060.01414.90
5.5.30.0060.01215.08
5.5.20.0060.01415.00
5.5.10.0050.01414.87
5.5.00.0070.01914.70
5.4.450.0070.02314.05
5.4.440.0080.01613.98
5.4.430.0080.01813.87
5.4.420.0090.02113.98
5.4.410.0040.02213.95
5.4.400.0070.02213.71
5.4.390.0090.01913.78
5.4.380.0060.02313.78
5.4.370.0050.02613.83
5.4.360.0090.01613.78
5.4.350.0090.01913.77
5.4.340.0080.01213.86
5.4.330.0100.00212.05
5.4.320.0050.01413.92
5.4.310.0080.01213.87
5.4.300.0090.01113.83
5.4.290.0080.01213.83
5.4.280.0090.01113.80
5.4.270.0060.01313.92
5.4.260.0030.01813.89
5.4.250.0070.02113.95
5.4.240.0070.01213.79
5.4.230.0070.01113.80
5.4.220.0070.01113.75
5.4.210.0070.01613.78
5.4.200.0060.01413.78
5.4.190.0060.01213.79
5.4.180.0060.01513.81
5.4.170.0070.02213.92
5.4.160.0080.01113.82
5.4.150.0080.01413.75
5.4.140.0070.01113.31
5.4.130.0050.01313.14
5.4.120.0060.01613.19
5.4.110.0050.01413.14
5.4.100.0060.01113.32
5.4.90.0060.01113.24
5.4.80.0060.01713.26
5.4.70.0060.01213.24
5.4.60.0040.01313.29
5.4.50.0050.01313.13
5.4.40.0050.01313.25
5.4.30.0070.01213.29
5.4.20.0060.01213.16
5.4.10.0070.01113.21
5.4.00.0040.01812.90
5.3.290.0040.01612.89
5.3.280.0050.01312.82
5.3.270.0050.01512.82
5.3.260.0050.01712.86
5.3.250.0080.00912.81
5.3.240.0050.01312.74
5.3.230.0040.01212.73
5.3.220.0080.01412.67
5.3.210.0060.01912.66
5.3.200.0070.01112.80
5.3.190.0060.01112.70
5.3.180.0040.01512.96
5.3.170.0050.01312.92
5.3.160.0050.01312.81
5.3.150.0070.01012.86
5.3.140.0090.01112.83
5.3.130.0060.01412.82
5.3.120.0050.01312.82
5.3.110.0030.01612.79
5.3.100.0030.01912.65
5.3.90.0070.01012.72
5.3.80.0020.01512.61
5.3.70.0040.01612.52
5.3.60.0060.01312.70
5.3.50.0070.01812.67
5.3.40.0070.02412.55
5.3.30.0090.02012.50
5.3.20.0080.01812.41
5.3.10.0060.02112.39
5.3.00.0040.02112.29
5.2.170.0070.02111.67
5.2.160.0040.02411.71
5.2.150.0050.02411.70
5.2.140.0030.02411.63
5.2.130.0060.01411.71
5.2.120.0040.02311.71
5.2.110.0060.02211.73
5.2.100.0080.02111.66
5.2.90.0040.02411.62
5.2.80.0020.01811.57
5.2.70.0050.02611.60
5.2.60.0050.02311.69
5.2.50.0050.02111.57
5.2.40.0070.02211.63
5.2.30.0070.01911.68
5.2.20.0060.02211.58
5.2.10.0100.01211.43
5.2.00.0040.02211.38
5.1.60.0020.01910.76
5.1.50.0070.01810.58
5.1.40.0040.02110.83
5.1.30.0050.01710.85
5.1.20.0050.02110.79
5.1.10.0040.02110.82
5.1.00.0030.01410.63
5.0.50.0050.0139.73
5.0.40.0040.0109.75
5.0.30.0040.0239.71
5.0.20.0030.0109.67
5.0.10.0030.0149.66
5.0.00.0030.0229.60
4.4.90.0010.0159.48
4.4.80.0010.0149.48
4.4.70.0020.0139.48
4.4.60.0040.0129.48
4.4.50.0030.0139.48
4.4.40.0010.0199.48
4.4.30.0020.0129.48
4.4.20.0030.0089.48
4.4.10.0010.0159.48
4.4.00.0020.0149.48
4.3.110.0020.0079.48
4.3.100.0020.0149.48
4.3.90.0000.0149.48
4.3.80.0050.0179.48
4.3.70.0020.0109.48
4.3.60.0040.0129.48
4.3.50.0030.0109.48
4.3.40.0060.0119.48
4.3.30.0030.0119.48
4.3.20.0020.0119.48
4.3.10.0010.0139.48
4.3.00.0020.0129.48

preferences:
60.35 ms | 401 KiB | 5 Q