3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = '123a'; $integer = -$string; // warning! $integer = (int) $string; $integer = -$integer; // too long! $integer = -(int)$string; // alright ! $integer = @-(int)$string; // also possible ! $integer = @-@(int)@$string; // too much?
Output for 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
Warning: A non-numeric value encountered in /in/m6F8G on line 5

preferences:
54.15 ms | 730 KiB | 4 Q