3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "2007-01-01"; $b = "2008-02-15"; $i = date("y-m", strtotime($a)); $y = date("y-m", strtotime($b)); while($i <= date("y-m", strtotime($b))){ echo $i."\n"; if(substr($i, 3, 2) == "12") $i = (date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1)."-01"; else $i++; } echo date('y', mktime(0,0,0,1,1,substr($i,0,2)))+1; // echo "Oct 3,1975 was on a ".date("y", mktime(0,0,0,10,3,7)) . "<br>";
Output for 8.5.0
07-01 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-02 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-03 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-04 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-05 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-06 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-07 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-08 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-09 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-10 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-11 Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/sCpr7 on line 13 07-12 Fatal error: Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in /in/sCpr7:15 Stack trace: #0 /in/sCpr7(15): mktime(0, 0, 0, 1, 1, '8-') #1 {main} thrown in /in/sCpr7 on line 15
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
07-01 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-02 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-03 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-04 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-05 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-06 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-07 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-08 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-09 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-10 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-11 Deprecated: Increment on non-alphanumeric string is deprecated in /in/sCpr7 on line 13 07-12 Fatal error: Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in /in/sCpr7:15 Stack trace: #0 /in/sCpr7(15): mktime(0, 0, 0, 1, 1, '8-') #1 {main} thrown in /in/sCpr7 on line 15
Process exited with code 255.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29
07-01 07-02 07-03 07-04 07-05 07-06 07-07 07-08 07-09 07-10 07-11 07-12 Fatal error: Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in /in/sCpr7:15 Stack trace: #0 /in/sCpr7(15): mktime(0, 0, 0, 1, 1, '8-') #1 {main} thrown in /in/sCpr7 on line 15
Process exited with code 255.
Output for 7.3.24 - 7.3.31, 7.4.12 - 7.4.33
07-01 07-02 07-03 07-04 07-05 07-06 07-07 07-08 07-09 07-10 07-11 07-12 Notice: A non well formed numeric value encountered in /in/sCpr7 on line 15 9
Output for 7.3.32 - 7.3.33
07-01 07-02 07-03 07-04 07-05 07-06 07-07 07-08 07-09 07-10 07-11 07-12 9

preferences:
58.44 ms | 415 KiB | 5 Q