3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 147 => [ "pts_m" => "", "pts_mreg" => 1, "pts_cg" => 1 ], 158 => [ "pts_m" => null , "pts_mreg" => null, "pts_cg" => 0 ], 159 => [ "pts_m" => "", "pts_mreg" => 1, "pts_cg" => 1 ] ]; $truthyCount = 0; foreach ($array as $row) { foreach ($row as $v) { $truthyCount += (bool) $v; } } var_export( array_sum( array_map(array_sum(...), ...$array) ) );
Output for git.master_jit, git.master
Fatal error: Uncaught ArgumentCountError: array_sum() expects exactly 1 argument, 3 given in /in/Rvf8L:29 Stack trace: #0 [internal function]: array_sum('', NULL, '') #1 /in/Rvf8L(29): array_map(Object(Closure), Array, Array, Array) #2 {main} thrown in /in/Rvf8L on line 29
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
25.4 ms | 405 KiB | 5 Q