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_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 ); echo $matches_month_word;exit; if ( $matches_month_word ) { 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.0130.00617.13
8.3.50.0090.00922.11
8.3.40.0150.00019.09
8.3.30.0080.01219.17
8.3.20.0000.00819.16
8.3.10.0090.00023.67
8.3.00.0050.00319.19
8.2.180.0090.00616.63
8.2.170.0110.00422.96
8.2.160.0070.00720.47
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00226.16
8.2.120.0040.00422.38
8.2.110.0190.00322.27
8.2.100.0060.00618.03
8.2.90.0090.00019.18
8.2.80.0000.00917.97
8.2.70.0060.00317.61
8.2.60.0040.00418.04
8.2.50.0100.00018.07
8.2.40.0050.00318.22
8.2.30.0030.00619.44
8.2.20.0040.00417.98
8.2.10.0060.00318.20
8.2.00.0000.00818.26
8.1.280.0120.00925.92
8.1.270.0040.00420.46
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00723.88
8.1.230.0120.00019.12
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0100.00017.48
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0060.00318.89
8.1.160.0040.00422.07
8.1.150.0000.00818.95
8.1.140.0040.00417.57
8.1.130.0030.00317.89
8.1.120.0070.00017.70
8.1.110.0030.00517.69
8.1.100.0040.00317.53
8.1.90.0040.00417.64
8.1.80.0040.00417.56
8.1.70.0030.00317.63
8.1.60.0000.00817.79
8.1.50.0040.00417.64
8.1.40.0040.00417.74
8.1.30.0080.00017.84
8.1.20.0040.00417.91
8.1.10.0040.00417.62
8.1.00.0000.00917.75
8.0.300.0040.00418.77
8.0.290.0040.00416.84
8.0.280.0000.00718.60
8.0.270.0040.00417.32
8.0.260.0030.00317.34
8.0.250.0050.00317.18
8.0.240.0030.00517.17
8.0.230.0070.00317.21
8.0.220.0020.00517.01
8.0.210.0000.00717.11
8.0.200.0040.00417.21
8.0.190.0040.00417.26
8.0.180.0050.00517.05
8.0.170.0080.00017.18
8.0.160.0040.00417.21
8.0.150.0040.00416.97
8.0.140.0040.00417.09
8.0.130.0050.00013.53
8.0.120.0050.00217.13
8.0.110.0040.00417.11
8.0.100.0040.00417.03
8.0.90.0050.00317.09
8.0.80.0030.01317.19
8.0.70.0050.00217.14
8.0.60.0050.00217.18
8.0.50.0040.00417.05
8.0.30.0100.00717.13
8.0.20.0090.01217.41
8.0.10.0080.00017.07
8.0.00.0160.01217.20
7.4.330.0000.00715.11
7.4.320.0000.00716.71
7.4.300.0000.00616.84
7.4.290.0000.00716.85
7.4.280.0060.00316.80
7.4.270.0030.00316.75
7.4.260.0030.00316.68
7.4.250.0080.00016.72
7.4.240.0060.00116.74
7.4.230.0030.00316.66
7.4.220.0100.02016.70
7.4.210.0100.00516.76
7.4.200.0040.00416.88
7.4.160.0090.00916.73
7.4.150.0070.01117.40
7.4.140.0130.00617.86
7.4.130.0130.00916.69
7.4.120.0100.00716.77
7.4.110.0170.00716.69
7.4.100.0110.00816.69
7.4.90.0100.01016.88
7.4.80.0100.00719.39
7.4.70.0060.01716.68
7.4.60.0060.01016.82
7.4.50.0030.00516.76
7.4.40.0110.00816.62
7.4.30.0080.00816.83
7.4.00.0100.00615.34
7.3.330.0030.00313.39
7.3.320.0000.00613.57
7.3.310.0050.00216.62
7.3.300.0030.00316.63
7.3.290.0030.00316.43
7.3.280.0100.00916.55
7.3.270.0040.01417.40
7.3.260.0070.01016.95
7.3.250.0110.00716.63
7.3.240.0090.00916.51
7.3.230.0000.01716.83
7.3.210.0070.01016.63
7.3.200.0160.00019.39
7.3.190.0120.00616.64
7.3.180.0080.00816.48
7.3.170.0090.01216.70
7.3.160.0070.01516.75
7.3.120.0060.01014.80
7.3.110.0060.01015.19
7.3.100.0070.00815.12
7.3.90.0070.00415.10
7.3.80.0060.00915.15
7.3.70.0070.00815.12
7.3.60.0070.00614.92
7.3.50.0060.01115.10
7.3.40.0080.00914.98
7.3.30.0090.00315.03
7.3.20.0070.00716.90
7.3.10.0060.01016.69
7.3.00.0060.00916.93
7.2.330.0150.00317.05
7.2.320.0100.00616.97
7.2.310.0030.01317.04
7.2.300.0030.01316.75
7.2.290.0160.00716.79
7.2.250.0030.01615.55
7.2.240.0100.00415.16
7.2.230.0070.00915.34
7.2.220.0060.00615.47
7.2.210.0020.01415.15
7.2.200.0060.00915.36
7.2.190.0070.00815.19
7.2.180.0070.00915.24
7.2.170.0050.01015.29
7.2.160.0060.00315.12
7.2.150.0070.01416.56
7.2.140.0060.01317.23
7.2.130.0040.01516.73
7.2.120.0060.00616.97
7.2.110.0060.00917.13
7.2.100.0110.00417.24
7.2.90.0040.00817.01
7.2.80.0070.01117.21
7.2.70.0030.01217.06
7.2.60.0060.00916.94
7.2.50.0120.00817.28
7.2.40.0100.01017.02
7.2.30.0070.01117.13
7.2.20.0120.00617.12
7.2.10.0030.00917.16
7.2.00.0030.01017.10
7.1.330.0100.00315.96
7.1.320.0020.01315.84
7.1.310.0050.00715.83
7.1.300.0050.00815.90
7.1.290.0030.01416.01
7.1.280.0050.00615.99
7.1.270.0060.00716.00
7.1.260.0060.00815.98
7.1.250.0060.00916.11
7.1.100.0030.00917.92
7.1.70.0030.01317.40
7.1.60.0070.02019.48
7.1.50.0110.01417.32
7.1.00.0070.07722.48
7.0.200.0030.00716.81
7.0.60.0030.04320.02
7.0.50.0030.08317.95
7.0.40.0000.05019.98
7.0.30.0230.05720.36
7.0.20.0300.04720.22
7.0.10.0200.04720.18
7.0.00.0070.04720.11
5.6.280.0030.07320.93
5.6.210.0100.08720.65
5.6.200.0100.05018.20
5.6.190.0030.05720.61
5.6.180.0100.06320.64
5.6.170.0330.07020.54
5.6.160.0100.03720.46
5.6.150.0030.08718.17
5.6.140.0030.04318.16
5.6.130.0000.06318.20
5.6.120.0070.04321.04
5.6.110.0070.08021.10
5.6.100.0230.07021.03
5.6.90.0000.07020.97
5.6.80.0100.05320.55
5.5.350.4370.04320.48
5.5.340.0070.08317.99
5.5.330.0100.07720.31
5.5.320.0200.06020.27
5.5.310.0230.06720.30
5.5.300.0030.05018.05
5.5.290.0100.08717.98
5.5.280.0070.04320.88
5.5.270.0030.05320.79
5.5.260.0000.06020.79
5.5.250.0130.07720.80
5.5.240.0070.05020.27
5.4.450.0370.05019.61
5.4.440.0530.05019.59
5.4.430.0230.05719.39
5.4.420.0030.06019.36
5.4.410.0100.05019.25
5.4.400.0130.05019.23
5.4.390.0100.05319.20
5.4.380.0130.05318.95
5.4.370.0070.05719.06
5.4.360.0100.05019.09
5.4.350.0170.04719.04
5.4.340.0030.06019.06
5.4.320.0100.06018.97
5.4.310.0070.05319.13
5.4.300.0000.06319.11
5.4.290.0100.05319.14
5.4.280.0100.05319.02
5.4.270.0170.04319.04
5.4.260.0100.05319.23
5.4.250.0000.06318.94
5.4.240.0030.06019.19
5.4.230.0070.05318.95
5.4.220.0070.05718.93
5.4.210.0130.04719.04
5.4.200.0170.04316.62
5.4.190.0100.05019.09
5.4.180.0130.05019.07
5.4.170.0130.05019.07
5.4.160.0170.04718.99
5.4.150.0070.05719.07
5.4.140.0030.06016.36
5.4.130.0030.05716.47
5.4.120.0070.05016.61
5.4.110.0070.05316.65
5.4.100.0070.06016.29
5.4.90.0070.05316.57
5.4.80.0100.04716.63
5.4.70.0070.05316.26
5.4.60.0100.04716.19
5.4.50.0200.05016.45
5.4.40.0070.05716.43
5.4.30.0070.05316.53
5.4.20.0070.05316.39
5.4.10.0030.05316.32
5.4.00.0030.05316.02
5.3.290.0000.06714.75
5.3.280.0030.06014.79
5.3.270.0000.06314.84
5.3.260.0030.05714.86
5.3.250.0130.04714.72
5.3.240.0030.05714.76
5.3.230.0100.05014.79
5.3.220.0200.04014.76
5.3.210.0030.06014.72
5.3.200.0030.05714.58
5.3.190.0030.06014.65
5.3.180.0070.05314.55
5.3.170.0100.05014.66
5.3.160.0170.05014.68
5.3.150.0130.05314.57
5.3.140.0100.05014.54
5.3.130.0070.05714.70
5.3.120.0000.06014.66
5.3.110.0030.05714.54
5.3.100.0070.05013.97
5.3.90.0100.05014.23
5.3.80.0100.04714.09
5.3.70.0070.05014.02
5.3.60.0170.04314.02
5.3.50.0070.05013.94
5.3.40.0170.04013.89
5.3.30.0070.05014.14
5.3.20.0100.04713.75
5.3.10.0070.05013.71
5.3.00.0070.05313.89
5.2.170.0100.04011.16
5.2.160.0130.03311.22
5.2.150.0070.04311.22
5.2.140.0100.04011.19
5.2.130.0070.06711.10
5.2.120.0070.04011.16
5.2.110.0070.04011.15
5.2.100.0030.04311.17
5.2.90.0200.04311.05
5.2.80.0030.04711.30
5.2.70.0130.03311.04
5.2.60.0070.04311.11
5.2.50.0130.04011.27
5.2.40.0130.04011.10
5.2.30.0070.04310.99
5.2.20.0070.04011.12
5.2.10.0000.04710.79
5.2.00.0000.04710.65
5.1.60.0070.0339.94
5.1.50.0070.03310.04
5.1.40.0070.0339.86
5.1.30.0070.03710.52
5.1.20.0070.03710.29
5.1.10.0000.04010.14
5.1.00.0100.03310.16
5.0.50.0030.0308.51
5.0.40.0070.0238.54
5.0.30.0070.0408.25
5.0.20.0070.0238.16
5.0.10.0100.0238.11
5.0.00.0030.0438.11
4.4.90.0070.0205.97
4.4.80.0070.0175.88
4.4.70.0070.0175.99
4.4.60.0070.0206.01
4.4.50.0000.0235.90
4.4.40.0030.0375.91
4.4.30.0000.0235.79
4.4.20.0000.0236.00
4.4.10.0000.0235.86
4.4.00.0000.0405.90
4.3.110.0070.0275.84
4.3.100.0030.0205.80
4.3.90.0030.0205.69
4.3.80.0030.0335.82
4.3.70.0070.0175.71
4.3.60.0000.0275.80
4.3.50.0030.0305.80
4.3.40.0100.0375.79
4.3.30.0030.0274.61
4.3.20.0070.0234.58
4.3.10.0030.0204.51
4.3.00.0100.0237.13

preferences:
32.43 ms | 401 KiB | 5 Q