3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $desired_services = array( array( 'job_service.service_id' => 51000071, 'job_service.site_id' => '100000002', ), array( 'job_service.service_id' => 51000075, 'job_service.site_id' => '100000002', ), array( 'job_service.service_id' => 51026110, 'job_service.site_id' => '100000002', ), ); $existing_services = array( array( 'job_service.service_id' => 51026110, 'job_service.site_id' => null, ), array( 'job_service.service_id' => 51000075, 'job_service.site_id' => null, ), array( 'job_service.service_id' => 51000071, 'job_service.site_id' => null, ), ); $new_services = array_udiff($desired_services, $existing_services, function ($left, $right) { $service_diff = $left[JobServicePeer::SERVICE_ID] - $left[JobServicePeer::SERVICE_ID]; if ($service_diff !== 0) { return $service_diff; } $site_diff = $left[JobServicePeer::SITE_ID] - $left[JobServicePeer::SITE_ID]; return $site_diff; }); var_dump($desired_services, $existing_services, $new_services); die();
based on saeB0
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'JobServicePeer' not found in /in/nBR2o:34 Stack trace: #0 [internal function]: {closure}(Array, Array) #1 /in/nBR2o(40): array_udiff(Array, Array, Object(Closure)) #2 {main} thrown in /in/nBR2o on line 34
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Class 'JobServicePeer' not found in /in/nBR2o on line 34
Process exited with code 255.