3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php unset($params['id']); $params['visible'] = true; // $originalData = array(); $originalData['visible'] = false; $changes = array_diff($params, $originalData); print_r($params); print_r($originalData); if (!$changes || !count($changes)) { print_r($changes); die('Not change'); return; } print_r($changes); die('change');
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: params in /in/FemdQ on line 2 Array ( [visible] => 1 ) Array ( [visible] => ) Array ( [visible] => 1 ) change
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: params in /in/FemdQ on line 2 Array ( [visible] => 1 ) Array ( [visible] => ) Array ( [visible] => 1 ) change