3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); // PHP 7.1 ALL error $nuova_data = '2021-10-05'; $row['BookID'] = 1; $query = "UPDATE book SET year = '$nuova_data' WHERE BookID = '$row'['BookID']"; //$query2 = $query = "UPDATE book SET year = '$nuova_data' WHERE BookID = '{$row['BookID']}'"; var_dump($query);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.14, 8.4.1
Warning: Array to string conversion in /in/21GA4 on line 5 string(68) "UPDATE book SET year = '2021-10-05' WHERE BookID = 'Array'['BookID']"
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Notice: Array to string conversion in /in/21GA4 on line 5 string(68) "UPDATE book SET year = '2021-10-05' WHERE BookID = 'Array'['BookID']"

preferences:
61.45 ms | 407 KiB | 5 Q