3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $originalData = array( 'id' => 42, 'title' => 'nope', 'desc' => 'meh', 'visible' => true, ); $params = $originalData; unset($params['id']); $params['visible'] = true; $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 4.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [title] => nope [desc] => meh [visible] => 1 ) Array ( [id] => 42 [title] => nope [desc] => meh [visible] => ) Array ( [visible] => 1 ) change
Output for hhvm-3.10.0

Process exited with code 153.