3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Warnings in 8.3 $n = null; --$n; // Warning: Decrement on type null has no effect, this will change in the next major version of PHP var_dump($n); // NULL $false = false; --$false; // Warning: Decrement on type bool has no effect, this will change in the next major version of PHP var_dump($false); // bool(false) ++$false; // Warning: Increment on type bool has no effect, this will change in the next major version of PHP var_dump($false); // bool(false) $true = true; --$true; // Warning: Decrement on type bool has no effect, this will change in the next major version of PHP var_dump($true); // bool(true) ++$true; // Warning: Increment on type bool has no effect, this will change in the next major version of PHP var_dump($true); // bool(true) // Deprecations in 8.3 $empty = ""; --$empty; // Deprecated: Decrement on empty string is deprecated as non-numeric var_dump($empty); // int(-1) $s = "foo"; --$s; // Deprecated: Decrement on non-numeric string has no effect and is deprecated var_dump($s); // string(3) "foo" $s = "-cc"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); // string(3) "-cd" $s = "Z "; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); // string(2) "Z " $s = " Z"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); // string(2) " A" # Non-ASCII characters $s = "é"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); # string(2) "é" $s = "あいうえお"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); # string(15) "あいうえお" $s = "α"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); # string(2) "α" $s = "1f.5"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); # string(4) "1f.6" $s = "1.f.5"; ++$s; // Deprecated: Increment on non-alphanumeric string is deprecated var_dump($s); # string(5) "1.f.6" // Deprecations in 8.5 (PR already merged, test with git.master version) $s = "foo"; ++$s; // Deprecated: Increment on non-numeric string is deprecated var_dump($s); // string(3) "fop"
Output for 8.5.0 - 8.5.7
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in /in/jYajv on line 8 NULL Warning: Decrement on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 12 bool(false) Warning: Increment on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 14 bool(false) Warning: Decrement on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 18 bool(true) Warning: Increment on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 20 bool(true) Deprecated: Decrement on empty string is deprecated as non-numeric in /in/jYajv on line 28 int(-1) Deprecated: Decrement on non-numeric string has no effect and is deprecated in /in/jYajv on line 32 string(3) "foo" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 36 string(3) "-cd" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 40 string(2) "Z " Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 44 string(2) " A" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 49 string(2) "é" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 52 string(15) "あいうえお" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 55 string(2) "α" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 58 string(4) "1f.6" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 62 string(5) "1.f.6" Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead in /in/jYajv on line 70 string(3) "fop"
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.21
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in /in/jYajv on line 8 NULL Warning: Decrement on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 12 bool(false) Warning: Increment on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 14 bool(false) Warning: Decrement on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 18 bool(true) Warning: Increment on type bool has no effect, this will change in the next major version of PHP in /in/jYajv on line 20 bool(true) Deprecated: Decrement on empty string is deprecated as non-numeric in /in/jYajv on line 28 int(-1) Deprecated: Decrement on non-numeric string has no effect and is deprecated in /in/jYajv on line 32 string(3) "foo" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 36 string(3) "-cd" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 40 string(2) "Z " Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 44 string(2) " A" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 49 string(2) "é" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 52 string(15) "あいうえお" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 55 string(2) "α" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 58 string(4) "1f.6" Deprecated: Increment on non-alphanumeric string is deprecated in /in/jYajv on line 62 string(5) "1.f.6" string(3) "fop"
Output for 8.1.34, 8.2.0 - 8.2.30
NULL bool(false) bool(false) bool(true) bool(true) int(-1) string(3) "foo" string(3) "-cd" string(2) "Z " string(2) " A" string(2) "é" string(15) "あいうえお" string(2) "α" string(4) "1f.6" string(5) "1.f.6" string(3) "fop"

preferences:
45.92 ms | 960 KiB | 4 Q