3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json=<<<EOF [ { "id":23, "uid":"0090000219", "cid":"0090000013", "extension":"201", "secret":"Myojyo42_f", "leader":true, "simultaneous":false, "confbridge_id":17, "created_at":"2015-09-02 12:49:12", "updated_at":"2015-09-02 12:49:12" }, { "id":24, "uid":"0090000221", "cid":"0090000013", "extension":"203", "secret":"Myojyo42_f", "leader":false, "simultaneous":false, "confbridge_id":17, "created_at":"2015-09-02 12:49:12", "updated_at":"2015-09-02 12:49:12" }, { "id":25, "uid":"0090000223", "cid":"0090000013", "extension":"205", "secret":"Myojyo42_f", "leader":false, "simultaneous":false, "confbridge_id":17, "created_at":"2015-09-10 10:16:24", "updated_at":"2015-09-10 10:16:24" } ] EOF; echo count (array_filter(function($a){ return $a->leader?1:0;}, json_decode($json)));
Output for 7.2.0
Warning: array_filter() expects parameter 1 to be array, object given in /in/5ehTb on line 45 Warning: count(): Parameter must be an array or an object that implements Countable in /in/5ehTb on line 45 0
Output for 5.4.0 - 7.1.10
Warning: array_filter() expects parameter 1 to be array, object given in /in/5ehTb on line 45 0