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.70.0100.00616.75
8.3.60.0160.00318.76
8.3.50.0070.01122.06
8.3.40.0130.00319.20
8.3.30.0070.00719.25
8.3.20.0040.00419.32
8.3.10.0040.00421.76
8.3.00.0050.00319.12
8.2.190.0120.00316.88
8.2.180.0090.00616.75
8.2.170.0140.00322.96
8.2.160.0150.00620.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.23
8.2.110.0070.00319.37
8.2.100.0090.00318.09
8.2.90.0000.00819.39
8.2.80.0030.00617.97
8.2.70.0060.00317.88
8.2.60.0040.00418.05
8.2.50.0050.00318.07
8.2.40.0000.00818.21
8.2.30.0040.00419.54
8.2.20.0050.00318.00
8.2.10.0080.00018.32
8.2.00.0000.00818.24
8.1.280.0090.00925.92
8.1.270.0140.00420.50
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00922.02
8.1.230.0080.00421.00
8.1.220.0000.00818.04
8.1.210.0000.00818.77
8.1.200.0060.00317.73
8.1.190.0030.00517.72
8.1.180.0030.00618.10
8.1.170.0050.00519.09
8.1.160.0000.00722.08
8.1.150.0000.00919.02
8.1.140.0000.00817.83
8.1.130.0050.00317.86
8.1.120.0030.00517.84
8.1.110.0000.00717.84
8.1.100.0000.00717.80
8.1.90.0000.00717.76
8.1.80.0040.00417.82
8.1.70.0030.00317.83
8.1.60.0030.00617.86
8.1.50.0060.00317.76
8.1.40.0030.00517.85
8.1.30.0040.00417.91
8.1.20.0040.00417.86
8.1.10.0040.00417.88
8.1.00.0030.00517.93
8.0.300.0040.00418.77
8.0.290.0030.00617.25
8.0.280.0000.00718.48
8.0.270.0030.00317.37
8.0.260.0000.00717.32
8.0.250.0040.00417.40
8.0.240.0000.00717.38
8.0.230.0030.00617.38
8.0.220.0040.00417.22
8.0.210.0070.00017.22
8.0.200.0030.00317.21
8.0.190.0060.00317.22
8.0.180.0040.00417.29
8.0.170.0050.00317.29
8.0.160.0080.00017.22
8.0.150.0000.00717.16
8.0.140.0030.00517.11
8.0.130.0000.00613.67
8.0.120.0000.00817.16
8.0.110.0050.00317.19
8.0.100.0050.00217.22
8.0.90.0040.00417.15
8.0.80.0030.01217.31
8.0.70.0040.00417.24
8.0.60.0040.00417.11
8.0.50.0040.00417.16
8.0.30.0080.01217.50
8.0.20.0150.01217.62
8.0.10.0040.00417.46
8.0.00.0110.01017.17
7.4.330.0030.00315.22
7.4.320.0000.00617.03
7.4.300.0030.00316.99
7.4.290.0030.00616.81
7.4.280.0080.00017.02
7.4.270.0030.00316.96
7.4.260.0000.00716.89
7.4.250.0050.00316.87
7.4.240.0020.00516.95
7.4.230.0030.00316.88
7.4.220.0120.00617.01
7.4.210.0100.00516.97
7.4.200.0000.00716.94
7.4.160.0070.01017.03
7.4.150.0070.02017.40
7.4.140.0140.01017.86
7.4.130.0130.00816.90
7.4.120.0180.00517.00
7.4.110.0130.01016.92
7.4.100.0060.01816.98
7.4.90.0090.00916.85
7.4.80.0130.01019.39
7.4.70.0100.01017.11
7.4.60.0100.00616.92
7.4.50.0060.00316.69
7.4.40.0210.00316.92
7.4.30.0180.00016.77
7.4.00.0070.01015.19
7.3.330.0000.00513.49
7.3.320.0050.00013.53
7.3.310.0040.00416.72
7.3.300.0040.00416.64
7.3.290.0000.00716.52
7.3.280.0060.01216.66
7.3.270.0230.00317.40
7.3.260.0090.00916.72
7.3.250.0110.00816.88
7.3.240.0130.00316.75
7.3.230.0120.00616.66
7.3.210.0130.00316.88
7.3.200.0110.01119.39
7.3.190.0110.00717.12
7.3.180.0100.00717.05
7.3.170.0110.00716.80
7.3.160.0060.01116.74
7.3.120.0120.00715.47
7.3.110.0080.00815.31
7.3.100.0050.00915.18
7.3.90.0070.00515.22
7.3.80.0050.00915.29
7.3.70.0060.00915.29
7.3.60.0060.00915.19
7.3.50.0050.01015.29
7.3.40.0060.00715.16
7.3.30.0010.01015.10
7.3.20.0060.00817.01
7.3.10.0020.01317.04
7.3.00.0060.00817.04
7.2.330.0090.01017.21
7.2.320.0100.01416.88
7.2.310.0070.01117.21
7.2.300.0070.01017.07
7.2.290.0150.00617.16
7.2.250.0090.00915.21
7.2.240.0100.00915.31
7.2.230.0080.00715.44
7.2.220.0040.01015.46
7.2.210.0080.00815.43
7.2.200.0040.00715.38
7.2.190.0040.01115.31
7.2.180.0050.00815.55
7.2.170.0040.00815.36
7.2.130.0070.01017.03
7.2.120.0000.01417.36
7.2.110.0060.00917.42
7.2.100.0000.01517.35
7.2.90.0070.00717.14
7.2.80.0060.00917.34
7.2.70.0060.00916.95
7.2.60.0050.01117.22
7.2.50.0040.00817.41
7.2.40.0030.01017.30
7.2.30.0070.01017.39
7.2.20.0040.01117.34
7.2.10.0070.00717.46
7.2.00.0060.00618.50
7.1.330.0070.00816.26
7.1.320.0110.00316.07
7.1.310.0050.00816.34
7.1.300.0050.00816.14
7.1.290.0020.01016.11
7.1.280.0040.00716.17
7.1.270.0060.00715.93
7.1.260.0060.00716.15
7.1.250.0070.00716.04
7.1.240.0040.01115.92
7.1.230.0030.00916.23
7.1.220.0060.00316.16
7.1.210.0060.00316.13
7.1.200.0050.00516.02
7.1.190.0000.01415.96
7.1.180.0000.01315.96
7.1.170.0090.00315.89
7.1.160.0060.00616.29
7.1.150.0040.00916.20
7.1.140.0070.01016.25
7.1.130.0070.00716.09
7.1.120.0000.01316.11
7.1.110.0080.00416.13
7.1.100.0080.00717.39
7.1.90.0030.01315.92
7.1.80.0070.00316.30
7.1.70.0060.00616.94
7.1.60.0080.00717.94
7.1.50.0080.01216.67
7.1.40.0060.00915.95
7.1.30.0090.00615.97
7.1.20.0070.00316.09
7.1.10.0030.00615.97
7.1.00.0030.04319.38
7.0.330.0030.01015.75
7.0.320.0030.01015.68
7.0.310.0040.01215.70
7.0.300.0040.00815.75
7.0.290.0040.00815.68
7.0.280.0030.00615.63
7.0.270.0070.00415.75
7.0.260.0080.00315.82
7.0.250.0100.00315.87
7.0.240.0100.00315.98
7.0.230.0000.01215.86
7.0.220.0000.01515.68
7.0.210.0070.00715.99
7.0.200.0010.00816.57
7.0.190.0070.00715.65
7.0.180.0090.00015.74
7.0.170.0030.01315.93
7.0.160.0000.01415.86
7.0.150.0060.00915.67
7.0.140.0040.00815.89
7.0.130.0090.00015.72
7.0.120.0090.00615.76
7.0.110.0060.00315.80
7.0.100.0030.01015.59
7.0.90.0080.04317.88
7.0.80.0110.02717.86
7.0.70.0140.03517.73
7.0.60.0080.02817.91
7.0.50.0100.03818.00
7.0.40.0100.03516.96
7.0.30.0060.03916.90
7.0.20.0060.03816.95
7.0.10.0070.04216.79
7.0.00.0060.02816.82
5.6.380.0060.00614.69
5.6.370.0030.01014.54
5.6.360.0030.00914.54
5.6.350.0150.00014.80
5.6.340.0050.00314.46
5.6.330.0040.01414.80
5.6.320.0080.00814.83
5.6.310.0070.00414.61
5.6.300.0090.00614.50
5.6.290.0070.00714.55
5.6.280.0050.04117.80
5.6.270.0070.01014.55
5.6.260.0030.00914.57
5.6.250.0130.00014.60
5.6.240.0070.03717.70
5.6.230.0070.03417.59
5.6.220.0050.04217.65
5.6.210.0060.02817.65
5.6.200.0090.04317.72
5.6.190.0080.04517.78
5.6.180.0100.04217.71
5.6.170.0090.04517.80
5.6.160.0080.02517.80
5.6.150.0060.03917.91
5.6.140.0060.02517.73
5.6.130.0160.03817.83
5.6.120.0070.03017.78
5.6.110.0060.04517.80
5.6.100.0050.04017.91
5.6.90.0050.04317.67
5.6.80.0050.03317.55
5.6.70.0070.02217.46
5.6.60.0080.03217.61
5.6.50.0050.04617.57
5.6.40.0020.04917.56
5.6.30.0080.03317.49
5.6.20.0080.03817.35
5.6.10.0070.03617.49
5.6.00.0100.02717.50
5.5.380.0030.03715.85
5.5.370.0070.04515.94
5.5.360.0100.03315.88
5.5.350.0050.04415.82
5.5.340.0070.04216.04
5.5.330.0080.04315.94
5.5.320.0030.03116.23
5.5.310.0070.03916.04
5.5.300.0030.03716.20
5.5.290.0050.02716.14
5.5.280.0020.04916.00
5.5.270.0070.02516.17
5.5.260.0100.02215.97
5.5.250.0080.04216.10
5.5.240.0050.02315.77
5.5.230.0050.04015.84
5.5.220.0150.03515.81
5.5.210.0030.03515.74
5.5.200.0080.03915.73
5.5.190.0060.04515.69
5.5.180.0050.04315.77
5.5.170.0030.00911.45
5.5.160.0070.03315.85
5.5.150.0030.02715.87
5.5.140.0120.03715.77
5.5.130.0080.02915.75
5.5.120.0050.02515.76
5.5.110.0070.02615.64
5.5.100.0020.03015.87
5.5.90.0030.03715.80
5.5.80.0030.04415.64
5.5.70.0080.04315.74
5.5.60.0060.04015.67
5.5.50.0040.04415.86
5.5.40.0030.04015.85
5.5.30.0090.03815.82
5.5.20.0040.04315.76
5.5.10.0030.04415.65
5.5.00.0060.02515.79
5.4.450.0050.04115.56
5.4.440.0060.02315.47
5.4.430.0060.02515.36
5.4.420.0100.04215.23
5.4.410.0070.03615.35
5.4.400.0060.04315.10
5.4.390.0000.02715.26
5.4.380.0120.03115.29
5.4.370.0050.04115.29
5.4.360.0020.04315.25
5.4.350.0080.04015.26
5.4.340.0050.03515.20
5.4.330.0050.00311.10
5.4.320.0110.03815.06
5.4.310.0110.03315.13
5.4.300.0050.04715.21
5.4.290.0070.03515.21
5.4.280.0020.04315.19
5.4.270.0060.03715.04
5.4.260.0070.02015.26
5.4.250.0070.04015.24
5.4.240.0020.04615.21
5.4.230.0080.03815.06
5.4.220.0030.04115.08
5.4.210.0070.03815.12
5.4.200.0100.03615.22
5.4.190.0050.04215.20
5.4.180.0090.02114.95
5.4.170.0050.02915.03
5.4.160.0080.02215.05
5.4.150.0100.04315.33
5.4.140.0050.03213.81
5.4.130.0060.03013.89
5.4.120.0070.02013.97
5.4.110.0090.02813.81
5.4.100.0030.04113.86
5.4.90.0070.02713.84
5.4.80.0050.04113.75
5.4.70.0070.02013.71
5.4.60.0080.03313.91
5.4.50.0070.03413.82
5.4.40.0040.04013.76
5.4.30.0070.04013.67
5.4.20.0030.03813.94
5.4.10.0030.03913.95
5.4.00.0070.02513.64
5.3.290.0080.03312.91
5.3.280.0100.02012.77
5.3.270.0030.04312.90
5.3.260.0090.02912.86
5.3.250.0050.02312.77
5.3.240.0090.03212.74
5.3.230.0110.03312.80
5.3.220.0020.04012.72
5.3.210.0020.03112.80
5.3.200.0030.02712.78
5.3.190.0050.04112.71
5.3.180.0030.03612.80
5.3.170.0040.02612.82
5.3.160.0050.02912.77
5.3.150.0040.04012.79
5.3.140.0060.04012.84
5.3.130.0050.03312.70
5.3.120.0050.02212.69
5.3.110.0060.03412.74
5.3.100.0050.04312.47
5.3.90.0080.03612.61
5.3.80.0020.03712.54
5.3.70.0130.03312.48
5.3.60.0050.04112.46
5.3.50.0090.03512.49
5.3.40.0100.03712.43
5.3.30.0070.03912.39
5.3.20.0060.02312.30
5.3.10.0070.02812.24
5.3.00.0050.03612.34
5.2.170.0020.01911.15
5.2.160.0020.03311.15
5.2.150.0030.02811.15
5.2.140.0020.02811.15
5.2.130.0030.02111.15
5.2.120.0020.03411.15
5.2.110.0080.03311.15
5.2.100.0040.03111.15
5.2.90.0040.02411.15
5.2.80.0060.03011.15
5.2.70.0060.03211.15
5.2.60.0050.03611.15
5.2.50.0030.03511.15
5.2.40.0050.03211.15
5.2.30.0030.03311.15
5.2.20.0030.03311.15
5.2.10.0030.03311.15
5.2.00.0050.03211.15
5.1.60.0030.01611.15
5.1.50.0000.03111.15
5.1.40.0040.02511.15
5.1.30.0070.02711.15
5.1.20.0020.02311.15
5.1.10.0000.01911.15
5.1.00.0030.02511.15
5.0.50.0010.02611.15
5.0.40.0050.02511.15
5.0.30.0050.01611.15
5.0.20.0050.02311.15
5.0.10.0070.01511.15
5.0.00.0020.01811.15
4.4.90.0000.02311.15
4.4.80.0020.01011.15
4.4.70.0020.01811.15
4.4.60.0040.01711.15
4.4.50.0040.01611.15
4.4.40.0010.01811.15
4.4.30.0020.01711.15
4.4.20.0030.01811.15
4.4.10.0000.01811.15
4.4.00.0000.02811.15
4.3.110.0010.01111.15
4.3.100.0000.01811.15
4.3.90.0030.01311.15
4.3.80.0000.02411.15
4.3.70.0000.01811.15
4.3.60.0030.01011.15
4.3.50.0010.01111.15
4.3.40.0020.01311.15
4.3.30.0010.01011.15
4.3.20.0000.01111.15
4.3.10.0020.01011.15
4.3.00.0020.01011.15

preferences:
43.91 ms | 401 KiB | 5 Q