3v4l.org

run code in 300+ PHP versions simultaneously
<?php $questanswer = 'happy all'; $wlist = array( array (4), array ('myself', 'labor', 'fresh', 'dollars', 'rose', 'quantity', 'mass', 'practices', 'therapy') ); $searchindex = 1; //convert object to array $convert = (array)$wlist; //now add the answer to it $convert[$searchindex][] = $questanswer; print_r($convert);

preferences:
48.08 ms | 402 KiB | 5 Q