3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=0); function add(int $a, int $b): int { return $a + $b; } var_dump(add("1apple", "2pear"));
based on M9I2o
Output for 7.0.0 - 7.3.0rc4
Notice: A non well formed numeric value encountered in /in/ahFpN on line 5 Notice: A non well formed numeric value encountered in /in/ahFpN on line 5 int(3)
Output for 5.5.0 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/ahFpN on line 3 Parse error: syntax error, unexpected ':', expecting '{' in /in/ahFpN on line 5
Process exited with code 255.