3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ ['foo', 'bar', 'baz="bazinga!"'], ['foo', 'bar', 'baz="bazinga!"'], ['foo', 'bar', 'baz="bazinga!"'], ['foo', 'bar', 'baz="bazinga!"'], ['foo', 'bar', 'baz="bazinga!"'], ['foo', 'bar', 'baz="bazinga!"'] ]; ob_start(); $buffer = fopen('php://output', 'w'); array_walk($a, function ($row) use ($buffer) { fputcsv($buffer, $row); }); $csv = ob_get_clean(); echo $csv;
Output for 8.4.1 - 8.4.2
Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!""" Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!""" Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!""" Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!""" Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!""" Deprecated: fputcsv(): the $escape parameter must be provided as its default value will change in /in/aougd on line 14 foo,bar,"baz=""bazinga!"""
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15
foo,bar,"baz=""bazinga!""" foo,bar,"baz=""bazinga!""" foo,bar,"baz=""bazinga!""" foo,bar,"baz=""bazinga!""" foo,bar,"baz=""bazinga!""" foo,bar,"baz=""bazinga!"""

preferences:
42.06 ms | 409 KiB | 5 Q