@ 2024-11-30T03:10:51Z <?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 += $v;
}
}
var_export($truthyCount);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.2.0 - 8.2.27 , 8.3.0 - 8.3.15 , 8.4.1 - 8.4.2 Fatal error: Uncaught TypeError: Unsupported operand types: int + string in /in/DDt7e:24
Stack trace:
#0 {main}
thrown in /in/DDt7e on line 24
Process exited with code 255 . preferences:dark mode live preview
42.95 ms | 406 KiB | 5 Q