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 ); if ( $matches_month_word ) { if ( $matches_month_word[1] ) $month = array_search( strtolower( $matches_month_word[1] ), $month_names ) + 1; } echo $string; echo $month;exit; //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.0060.01617.00
8.3.50.0100.01022.18
8.3.40.0150.00019.27
8.3.30.0110.00419.01
8.3.20.0060.00319.15
8.3.10.0080.00023.65
8.3.00.0040.00419.19
8.2.180.0060.01217.00
8.2.170.0120.00919.02
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00522.25
8.2.110.0060.00320.47
8.2.100.0090.00318.22
8.2.90.0000.00819.40
8.2.80.0000.00818.00
8.2.70.0000.00917.88
8.2.60.0080.00017.93
8.2.50.0040.00418.07
8.2.40.0050.00318.34
8.2.30.0000.00719.39
8.2.20.0000.00817.91
8.2.10.0000.00918.20
8.2.00.0100.00018.05
8.1.280.0070.01325.92
8.1.270.0080.00020.55
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0000.00922.32
8.1.230.0070.00419.21
8.1.220.0040.00417.89
8.1.210.0060.00318.77
8.1.200.0040.00817.48
8.1.190.0060.00317.48
8.1.180.0050.00318.10
8.1.170.0000.00818.89
8.1.160.0030.00522.07
8.1.150.0020.00518.94
8.1.140.0000.00717.63
8.1.130.0040.00417.93
8.1.120.0040.00417.55
8.1.110.0040.00417.59
8.1.100.0000.00817.66
8.1.90.0000.00717.59
8.1.80.0070.00017.61
8.1.70.0050.00217.66
8.1.60.0000.00917.81
8.1.50.0000.00817.73
8.1.40.0040.00417.68
8.1.30.0030.00517.69
8.1.20.0030.00517.86
8.1.10.0040.00417.77
8.1.00.0000.00817.63
8.0.300.0000.00818.77
8.0.290.0080.00017.00
8.0.280.0030.00518.50
8.0.270.0030.00317.24
8.0.260.0000.00817.25
8.0.250.0000.00717.20
8.0.240.0000.00717.20
8.0.230.0030.00617.14
8.0.220.0070.00017.18
8.0.210.0070.00017.13
8.0.200.0030.00317.24
8.0.190.0040.00417.23
8.0.180.0040.00417.05
8.0.170.0060.00317.16
8.0.160.0090.00017.19
8.0.150.0000.00717.14
8.0.140.0000.00717.05
8.0.130.0040.00413.58
8.0.120.0030.00517.13
8.0.110.0080.00016.99
8.0.100.0000.00717.01
8.0.90.0020.00516.96
8.0.80.0040.01117.09
8.0.70.0030.00517.16
8.0.60.0040.00417.20
8.0.50.0060.00316.99
8.0.30.0110.00716.98
8.0.20.0120.01017.47
8.0.10.0000.00817.33
8.0.00.0060.01417.15
7.4.330.0030.00315.03
7.4.320.0000.00716.61
7.4.300.0070.00016.76
7.4.290.0070.00016.80
7.4.280.0080.00016.80
7.4.270.0000.00816.78
7.4.260.0050.00216.88
7.4.250.0070.00016.72
7.4.240.0040.00416.74
7.4.230.0000.00716.50
7.4.220.0110.01216.96
7.4.210.0060.01016.84
7.4.200.0000.00716.64
7.4.160.0070.01116.72
7.4.150.0070.01117.40
7.4.140.0090.01017.86
7.4.130.0150.00516.81
7.4.120.0100.00816.71
7.4.110.0200.00016.86
7.4.100.0090.01516.92
7.4.90.0110.00716.77
7.4.80.0160.00319.39
7.4.70.0060.01316.71
7.4.60.0100.01016.73
7.4.50.0000.00816.77
7.4.40.0080.00816.56
7.4.30.0090.01316.50
7.4.00.0070.01015.05
7.3.330.0050.00013.35
7.3.320.0000.00513.47
7.3.310.0000.00716.66
7.3.300.0070.00016.63
7.3.290.0070.00016.57
7.3.280.0120.00716.57
7.3.270.0130.00317.40
7.3.260.0180.00016.75
7.3.250.0130.01016.65
7.3.240.0030.01316.92
7.3.230.0140.00916.67
7.3.210.0040.01316.62
7.3.200.0100.01019.39
7.3.190.0090.01516.78
7.3.180.0130.00316.74
7.3.170.0060.01216.62
7.3.160.0120.00916.74
7.3.120.0040.01415.01
7.3.110.0140.00314.98
7.3.100.0090.00615.00
7.3.90.0070.00715.03
7.3.80.0000.00915.06
7.3.70.0090.00614.86
7.3.60.0070.00714.89
7.3.50.0040.01115.13
7.3.40.0060.00315.08
7.3.30.0120.00414.89
7.3.20.0040.00816.60
7.3.10.0060.00816.80
7.3.00.0060.00617.07
7.2.330.0100.01016.83
7.2.320.0070.01316.92
7.2.310.0090.01616.85
7.2.300.0030.01316.62
7.2.290.0180.00916.91
7.2.250.0100.01015.55
7.2.240.0060.01315.34
7.2.230.0040.01115.05
7.2.220.0130.00615.27
7.2.210.0070.00715.28
7.2.200.0030.01215.20
7.2.190.0060.00815.29
7.2.180.0070.00715.34
7.2.170.0090.00615.33
7.2.60.0090.00617.18
7.2.00.0030.01419.84
7.1.330.0030.01015.64
7.1.320.0090.00916.18
7.1.310.0030.01015.98
7.1.300.0040.01115.70
7.1.290.0030.01016.06
7.1.280.0060.00915.98
7.1.270.0120.00616.07
7.1.260.0040.01115.92
7.1.200.0030.00615.94
7.1.100.0040.00718.39
7.1.70.0030.00717.40
7.1.60.0070.01719.48
7.1.50.0130.01016.99
7.1.00.0070.07022.35
7.0.200.0050.00316.68
7.0.60.0100.08319.99
7.0.50.0030.09017.84
7.0.40.0070.05320.17
7.0.30.0270.04720.32
7.0.20.0370.06020.32
7.0.10.0170.08020.11
7.0.00.0070.05020.24
5.6.280.0030.07320.80
5.6.210.0130.07720.50
5.6.200.0000.04318.16
5.6.190.0070.04020.55
5.6.180.0070.06020.57
5.6.170.0200.03720.48
5.6.160.0100.06020.47
5.6.150.0100.08018.28
5.6.140.0130.03718.13
5.6.130.0030.08318.13
5.6.120.0100.08321.05
5.6.110.0100.06321.16
5.6.100.0100.08321.02
5.6.90.0030.07321.10
5.6.80.0130.07320.40
5.5.350.0000.03320.48
5.5.340.0000.04318.08
5.5.330.0100.08320.29
5.5.320.0000.04720.32
5.5.310.0270.04720.29
5.5.300.0030.05017.95
5.5.290.0030.04018.00
5.5.280.0070.08320.75
5.5.270.0070.08720.75
5.5.260.0100.08320.75
5.5.250.0070.05320.47
5.5.240.0000.05720.13
5.4.450.0930.03319.53
5.4.440.0600.06019.44
5.4.430.0130.05019.54
5.4.420.0100.05319.21
5.4.410.0100.07019.40
5.4.400.0030.05719.10
5.4.390.0070.05319.21
5.4.380.0100.05719.09
5.4.370.0070.05319.20
5.4.360.0130.04719.25
5.4.350.0030.06019.04
5.4.340.0030.05719.07
5.4.320.0100.05319.13
5.4.310.0070.05719.06
5.4.300.0130.07019.04
5.4.290.0170.07019.24
5.4.280.0130.07319.09
5.4.270.0100.08018.98
5.4.260.0170.04719.07
5.4.250.0070.05719.10
5.4.240.0030.06019.05
5.4.230.0100.05318.96
5.4.220.0170.04719.22
5.4.210.0100.05319.22
5.4.200.0100.05016.63
5.4.190.0030.05719.04
5.4.180.0070.05319.04
5.4.170.0130.06719.04
5.4.160.0200.05019.11
5.4.150.0130.05019.22
5.4.140.0270.03316.51
5.4.130.0170.04316.39
5.4.120.0130.05016.56
5.4.110.0130.04716.65
5.4.100.0070.05316.55
5.4.90.0200.04316.39
5.4.80.0130.04716.50
5.4.70.0070.05316.23
5.4.60.0030.05316.52
5.4.50.0070.05316.20
5.4.40.0070.05316.12
5.4.30.0030.05316.49
5.4.20.0130.04716.22
5.4.10.0070.05016.44
5.4.00.0070.05015.70
5.3.290.0100.05314.60
5.3.280.0000.06014.75
5.3.270.0030.06014.81
5.3.260.0070.05714.80
5.3.250.0170.06714.83
5.3.240.0100.05314.60
5.3.230.0170.06314.59
5.3.220.0030.05314.68
5.3.210.0070.05714.55
5.3.200.0070.05314.81
5.3.190.0070.05314.50
5.3.180.0100.07014.61
5.3.170.0070.05714.55
5.3.160.0170.04014.50
5.3.150.0100.05014.61
5.3.140.0100.05014.61
5.3.130.0070.05314.68
5.3.120.0100.06014.59
5.3.110.0070.08014.54
5.3.100.0130.06014.25
5.3.90.0070.05314.08
5.3.80.0070.05314.21
5.3.70.0000.06014.02
5.3.60.0130.04314.21
5.3.50.0200.05714.20
5.3.40.0100.06714.15
5.3.30.0030.07313.84
5.3.20.0100.06313.69
5.3.10.0130.06313.60
5.3.00.0170.06013.88
5.2.170.0100.05311.39
5.2.160.0100.05311.20
5.2.150.0030.06011.20
5.2.140.0100.05311.36
5.2.130.0000.04711.36
5.2.120.0100.04011.27
5.2.110.0100.03711.35
5.2.100.0000.04711.15
5.2.90.0070.04011.10
5.2.80.0030.04711.04
5.2.70.0170.03311.09
5.2.60.0130.03711.09
5.2.50.0030.04711.26
5.2.40.0030.04310.99
5.2.30.0070.04011.19
5.2.20.0030.04311.07
5.2.10.0070.04710.95
5.2.00.0070.04010.73
5.1.60.0100.0309.95
5.1.50.0100.0339.87
5.1.40.0070.04710.14
5.1.30.0070.05010.32
5.1.20.0130.04310.32
5.1.10.0100.0439.99
5.1.00.0070.05010.01
5.0.50.0130.0308.57
5.0.40.0100.0338.45
5.0.30.0030.0478.18
5.0.20.0030.0308.23
5.0.10.0070.0278.11
5.0.00.0070.0408.21
4.4.90.0030.0235.96
4.4.80.0000.0235.86
4.4.70.0000.0235.96
4.4.60.0000.0236.02
4.4.50.0030.0205.88
4.4.40.0000.0375.82
4.4.30.0070.0235.95
4.4.20.0030.0236.03
4.4.10.0000.0275.85
4.4.00.0030.0375.95
4.3.110.0070.0235.84
4.3.100.0000.0275.90
4.3.90.0030.0275.73
4.3.80.0000.0475.82
4.3.70.0000.0275.69
4.3.60.0000.0235.79
4.3.50.0070.0235.88
4.3.40.0000.0435.65
4.3.30.0070.0174.56
4.3.20.0000.0234.58
4.3.10.0000.0234.43
4.3.00.0200.01716.00

preferences:
57.97 ms | 401 KiB | 5 Q