3v4l.org

run code in 300+ PHP versions simultaneously
<?php function find_date( $string ) { //Define month name: $month_names = array( "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" ); $month_name_shorts = array( "jan" ); $month_number=$month=$matches_year=$year=$matches_month_number=$matches_month_word=$matches_day_number=""; //Match dates: 01/01/2012 or 30-12-11 or 1 2 1985 preg_match( '/([0-9]?[0-9])[\.\-\/ ]?([0-1]?[0-9])[\.\-\/ ]?([0-9]{2,4})/', $string, $matches ); if ( $matches ) { if ( $matches[1] ) $day = $matches[1]; if ( $matches[2] ) $month = $matches[2]; if ( $matches[3] ) $year = $matches[3]; } //Match month name: preg_match( '/(' . implode( '|', $month_names ) . ')/i', $string, $matches_month_word ); if ( $matches_month_word ) { echo strtolower( $matches_month_word[1]);exit; if ( $matches_month_word[1] ) $month = array_search( strtolower( $matches_month_word[1] ), $month_names ) + 1; } //Match 5th 1st day: preg_match( '/([0-9]?[0-9])(st|nd|th)/', $string, $matches_day ); if ( $matches_day ) { if ( $matches_day[1] ) $day = $matches_day[1]; } //Match Year if not already setted: if ( empty( $year ) ) { preg_match( '/[0-9]{2}/', $string, $matches_year ); if ( $matches_year[0] ) $year = $matches_year[0]; } if ( ! empty ( $day ) && ! empty ( $month ) && empty( $year ) ) { preg_match( '/[0-9]{2}/', $string, $matches_year ); if ( $matches_year[0] ) $year = $matches_year[0]; } $day = '01'; //Leading 0 if ( 1 == strlen( $day ) ) $day = '0' . $day; //Leading 0 if ( 1 == strlen( $month ) ) $month = '0' . $month; //Check year: if ( 2 == strlen( $year ) && $year > 20 ) $year = '19' . $year; else if ( 2 == strlen( $year ) && $year < 20 ) $year = '20' . $year; $date = array( 'year' => $year, 'month' => $month, 'day' => $day ); //Return false if nothing found: if ( empty( $year ) && empty( $month ) && empty( $day ) ) return false; else return date('Y-m-d',strtotime($date['year'].'-'.$date['month'].'-01')); } echo find_date('Fund Factsheet Syariah - Jan 1914');

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.0100.01016.88
8.3.50.0090.01123.13
8.3.40.0180.00019.36
8.3.30.0110.00419.29
8.3.20.0030.00519.27
8.3.10.0080.00021.96
8.3.00.0080.00019.04
8.2.180.0130.00716.75
8.2.170.0040.01422.96
8.2.160.0100.00320.55
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0080.00022.14
8.2.110.0090.00920.44
8.2.100.0080.00418.22
8.2.90.0000.00919.34
8.2.80.0040.00418.00
8.2.70.0040.00418.00
8.2.60.0030.00517.93
8.2.50.0050.00318.07
8.2.40.0000.00818.45
8.2.30.0030.00519.31
8.2.20.0050.00317.98
8.2.10.0030.00518.29
8.2.00.0060.00318.16
8.1.280.0070.01025.92
8.1.270.0090.00920.33
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0070.01022.30
8.1.230.0040.00719.13
8.1.220.0050.00317.75
8.1.210.0030.00518.77
8.1.200.0100.00017.85
8.1.190.0050.00317.50
8.1.180.0030.00518.10
8.1.170.0060.00318.73
8.1.160.0000.00822.02
8.1.150.0080.00019.05
8.1.140.0080.00017.78
8.1.130.0040.00418.05
8.1.120.0000.00717.86
8.1.110.0020.00517.73
8.1.100.0000.00817.75
8.1.90.0000.00817.88
8.1.80.0000.00717.80
8.1.70.0040.00417.79
8.1.60.0040.00417.78
8.1.50.0030.00617.82
8.1.40.0050.00317.79
8.1.30.0030.00517.94
8.1.20.0000.00817.93
8.1.10.0080.00017.79
8.1.00.0030.00517.80
8.0.300.0000.00818.77
8.0.290.0000.00717.25
8.0.280.0070.00018.48
8.0.270.0030.00317.32
8.0.260.0040.00417.30
8.0.250.0000.00817.36
8.0.240.0030.00317.30
8.0.230.0030.00717.22
8.0.220.0040.00417.31
8.0.210.0000.00717.16
8.0.200.0030.00317.30
8.0.190.0060.00317.35
8.0.180.0040.00417.28
8.0.170.0040.00417.32
8.0.160.0030.00517.16
8.0.150.0050.00317.22
8.0.140.0050.00317.23
8.0.130.0030.00613.57
8.0.120.0030.00617.21
8.0.110.0050.00317.29
8.0.100.0080.00017.22
8.0.90.0000.00717.39
8.0.80.0180.00317.21
8.0.70.0040.00417.15
8.0.60.0000.00717.31
8.0.50.0000.00717.29
8.0.30.0060.01417.37
8.0.20.0100.01017.75
8.0.10.0050.00317.43
8.0.00.0090.01017.10
7.4.330.0000.00515.23
7.4.320.0030.00317.00
7.4.300.0070.00016.91
7.4.290.0030.00616.99
7.4.280.0080.00016.89
7.4.270.0000.00716.98
7.4.260.0070.00016.89
7.4.250.0040.00416.98
7.4.240.0020.00516.93
7.4.230.0040.00416.99
7.4.220.0130.00716.93
7.4.210.0070.01016.93
7.4.200.0040.00416.80
7.4.160.0100.00617.01
7.4.150.0160.00617.40
7.4.140.0180.00817.86
7.4.130.0130.00816.96
7.4.120.0120.00716.97
7.4.110.0070.01116.93
7.4.100.0150.00817.00
7.4.90.0130.00316.90
7.4.80.0090.00919.39
7.4.70.0060.01216.99
7.4.60.0100.00716.88
7.4.50.0030.00616.97
7.4.40.0090.01217.01
7.4.30.0060.01216.91
7.4.00.0160.00015.49
7.3.330.0050.00013.49
7.3.320.0030.00313.64
7.3.310.0000.00816.70
7.3.300.0040.00416.64
7.3.290.0030.00316.58
7.3.280.0080.01016.66
7.3.270.0030.01617.40
7.3.260.0120.01216.82
7.3.250.0120.00716.81
7.3.240.0070.01016.72
7.3.230.0090.00916.59
7.3.210.0100.00716.85
7.3.200.0090.01319.39
7.3.190.0130.00317.00
7.3.180.0410.00716.79
7.3.170.0110.00716.66
7.3.160.0090.00916.87
7.2.330.0280.01717.04
7.2.320.0170.00717.01
7.2.310.0030.01517.22
7.2.300.0030.01517.04
7.2.290.0110.01116.88
7.2.60.0000.01317.23
7.1.200.0000.01115.88
7.1.70.0030.00717.41
7.1.60.0120.01219.48
7.1.50.0170.00717.09
7.1.00.0070.07322.39
7.0.200.0000.00917.21
7.0.100.0070.04720.09
7.0.90.0130.04319.93
7.0.80.0270.03319.89
7.0.70.0070.03319.89
7.0.60.0070.03319.98
7.0.50.0070.04020.43
7.0.40.0030.05320.14
7.0.30.0130.07719.96
7.0.20.0100.03020.05
7.0.10.0070.08020.14
7.0.00.0030.07720.04
5.6.280.0000.07720.89
5.6.250.0030.04720.75
5.6.240.0030.04320.54
5.6.230.0030.04320.61
5.6.220.0070.04020.52
5.6.210.0030.04020.67
5.6.200.0070.04021.05
5.6.190.0070.03321.15
5.6.180.0000.04021.07
5.6.170.0070.09021.05
5.6.160.0070.08021.14
5.6.150.0100.08021.03
5.6.140.0030.07320.96
5.6.130.0100.08721.06
5.6.120.0070.08721.14
5.6.110.0100.09021.04
5.6.100.0170.07320.95
5.6.90.0100.05320.93
5.6.80.0100.08320.45
5.6.70.0070.07020.48
5.6.60.0070.06020.53
5.6.50.0030.06320.51
5.6.40.0100.07720.39
5.6.30.0100.07320.27
5.6.20.0200.06720.40
5.6.10.0070.07720.43
5.6.00.0130.07720.32
5.5.380.0030.04320.41
5.5.370.0000.04720.42
5.5.360.0030.04020.46
5.5.350.0000.04320.46
5.5.340.0030.04020.88
5.5.330.0070.07020.86
5.5.320.0070.03320.80
5.5.310.0030.08720.94
5.5.300.0100.04020.93
5.5.290.0170.07320.90
5.5.280.0100.08020.80
5.5.270.0130.08020.91
5.5.260.0100.04320.65
5.5.250.0030.08720.66
5.5.240.0100.07720.21
5.5.230.0170.07020.00
5.5.220.0070.05020.29
5.5.210.0070.05020.04
5.5.200.0130.07320.11
5.5.190.0030.04020.23
5.5.180.0100.07320.12
5.5.160.0130.08020.13
5.5.150.0000.08720.20
5.5.140.0070.04320.24
5.5.130.0000.05020.14
5.5.120.0030.05320.27
5.5.110.0100.07320.29
5.5.100.0070.08320.08
5.5.90.0170.06320.09
5.5.80.0030.08020.03
5.5.70.0030.08020.08
5.5.60.0000.05020.08
5.5.50.0030.06020.07
5.5.40.0030.08019.98
5.5.30.0130.07320.15
5.5.20.0100.08020.02
5.5.10.0100.07720.05
5.5.00.0000.08020.09
5.4.450.0170.07719.28
5.4.440.0100.07719.17
5.4.430.0030.06319.46
5.4.420.0070.08319.22
5.4.410.0030.08019.23
5.4.400.0070.08019.05
5.4.390.0100.07319.13
5.4.380.0100.07319.15
5.4.370.0070.07319.16
5.4.360.0100.07719.04
5.4.350.0070.06719.08
5.4.340.0200.06719.14
5.4.320.0030.07319.23
5.4.310.0030.05319.03
5.4.300.0000.05019.13
5.4.290.0100.03319.09
5.4.280.0100.03718.81
5.4.270.0030.04019.04
5.4.260.0100.06719.09
5.4.250.0130.07719.23
5.4.240.0100.04018.87
5.4.230.0030.07319.12
5.4.220.0070.07719.00
5.4.210.0200.05718.84
5.4.200.0070.04019.02
5.4.190.0070.06018.84
5.4.180.0070.07719.17
5.4.170.0100.07318.87
5.4.160.0030.04019.03
5.4.150.0030.08019.21
5.4.140.0030.08016.49
5.4.130.0100.06716.45
5.4.120.0030.04316.46
5.4.110.0070.07316.55
5.4.100.0030.05316.49
5.4.90.0030.07716.56
5.4.80.0030.04316.46
5.4.70.0000.07316.47
5.4.60.0100.07316.50
5.4.50.0100.06716.49
5.4.40.0000.08016.41
5.4.30.0170.06016.38
5.4.20.0030.07316.37
5.4.10.0100.07716.53
5.4.00.0030.08015.92
5.3.290.0070.06014.72
5.3.280.0030.04714.73
5.3.270.0100.07714.56
5.3.260.0030.07714.75
5.3.250.0030.04014.75
5.3.240.0070.07314.68
5.3.230.0100.07314.57
5.3.220.0000.04314.61
5.3.210.0100.06714.56
5.3.200.0130.07014.51
5.3.190.0100.05714.65
5.3.180.0070.05014.51
5.3.170.0070.07014.58
5.3.160.0070.07714.73
5.3.150.0000.05314.59
5.3.140.0000.04714.64
5.3.130.0070.04314.69
5.3.120.0070.07714.66
5.3.110.0000.08014.50
5.3.100.0000.08314.03
5.3.90.0030.05014.04
5.3.80.0070.06714.05
5.3.70.0130.06014.07
5.3.60.0100.07013.93
5.3.50.0070.07313.88
5.3.40.0000.08313.99
5.3.30.0030.04313.93
5.3.20.0030.06713.69
5.3.10.0100.06713.73
5.3.00.0030.07313.72
5.2.170.0000.05312.69
5.2.160.0070.06012.69
5.2.150.0070.04312.69
5.2.140.0070.06312.69
5.2.130.0030.03712.69
5.2.120.0070.06012.69
5.2.110.0070.06312.69
5.2.100.0130.05312.69
5.2.90.0030.06712.69
5.2.80.0070.05712.69
5.2.70.0000.04012.69
5.2.60.0130.05712.69
5.2.50.0100.05712.69
5.2.40.0030.06012.69
5.2.30.0070.04712.69
5.2.20.0000.06012.69
5.2.10.0070.06012.69
5.2.00.0000.06012.69
5.1.60.0000.04012.69
5.1.50.0000.04312.69
5.1.40.0030.06012.69
5.1.30.0070.05012.69
5.1.20.0070.03712.69
5.1.10.0000.04012.69
5.1.00.0000.03312.69
5.0.50.0100.03012.69
5.0.40.0030.04312.69
5.0.30.0000.06712.69
5.0.20.0030.04312.69
5.0.10.0030.04312.69
5.0.00.0030.06312.69
4.4.90.0000.03712.69
4.4.80.0000.03712.69
4.4.70.0100.02012.69
4.4.60.0000.03012.69
4.4.50.0070.02712.69
4.4.40.0000.06012.69
4.4.30.0030.03712.69
4.4.20.0000.03312.69
4.4.10.0030.03712.69
4.4.00.0070.05012.69
4.3.110.0030.03712.69
4.3.100.0030.02312.69
4.3.90.0000.02312.69
4.3.80.0000.05312.69
4.3.70.0070.03012.69
4.3.60.0070.03312.69
4.3.50.0030.03712.69
4.3.40.0000.05712.69
4.3.30.0000.02312.69
4.3.20.0000.02012.69
4.3.10.0000.02312.69
4.3.00.0030.03012.69

preferences:
36.81 ms | 401 KiB | 5 Q