3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $pad = 'fc15:7e4c:69c9:83a3:9c0a:c738:3f27:0883'; $npad = 'fc15:7e4c:69c9:83a3:9c0a:c738:3f27:883'; $cpad = filter_var($pad, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6); $cnpad = filter_var($npad, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6); $resp = [ 'pad' => $pad, 'not-padded' => $npad, 'padded filter_var' => $cpad, 'not-padded filter_var' => $cnpad ]; var_dump($resp);
Output for 5.4.0 - 7.2.0
array(4) { ["pad"]=> string(39) "fc15:7e4c:69c9:83a3:9c0a:c738:3f27:0883" ["not-padded"]=> string(38) "fc15:7e4c:69c9:83a3:9c0a:c738:3f27:883" ["padded filter_var"]=> string(39) "fc15:7e4c:69c9:83a3:9c0a:c738:3f27:0883" ["not-padded filter_var"]=> string(38) "fc15:7e4c:69c9:83a3:9c0a:c738:3f27:883" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/Fa162 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/Fa162 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/Fa162 on line 7
Process exited with code 255.