3v4l.org

run code in 200+ PHP versions simultaneously
<?php var_dump((new ReflectionFunction('fputcsv'))->getNumberOfParameters()); $fp = fopen('php://temp', 'r+'); $res = fputcsv($fp, [1, 2, 3], ',', '"', '\\'); var_dump($res);
based on B3qfc
Output for 7.0.20, 7.1.5 - 7.4.0
int(5) int(6)
Output for 5.5.4 - 7.0.16, 7.1.0 - 7.1.2
int(4) int(6)
Output for 5.4.0 - 5.5.3
int(4) Warning: fputcsv() expects at most 4 parameters, 5 given in /in/WARpp on line 5 NULL
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/WARpp on line 3
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 T_OBJECT_OPERATOR in /in/WARpp on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/WARpp on line 3
Process exited with code 255.