<?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"
You have javascript disabled. You will not be able to edit any code.