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.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Warning: A non-numeric value encountered in /in/m6F8G on line 5

preferences:
44.48 ms | 749 KiB | 4 Q