3v4l.org

run code in 300+ PHP versions simultaneously
<?php $struct = [ 'a1' => [ 'atr' => 'atr_a1' , 'form' => 'form_a1'], 'a1_2' => [ 'atr' => 'atr_a1' , 'form' => 'form_a1_2'], 'a1_3' => [ 'atr' => 'atr_a1_2', 'form' => 'form_a1'], 'b1' => [ 'atr' => 'atr_b1'], 'c1' => [ 'form' => 'form_c1'], 'c1' => [ 'atr' => null, 'form' => 'form_c1'], ]; var_dump(array_column(array_filter($struct, static function (array $s): bool { return $s['atr'] && $s['form']; }), 'atr', 'form'));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined array key "form" in /in/MAnK7 on line 14 array(2) { ["form_a1"]=> string(8) "atr_a1_2" ["form_a1_2"]=> string(6) "atr_a1" }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined array key "form" in /in/MAnK7 on line 14 array(2) { ["form_a1"]=> string(8) "atr_a1_2" ["form_a1_2"]=> string(6) "atr_a1" }
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.3.33, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined index: form in /in/MAnK7 on line 14 array(2) { ["form_a1"]=> string(8) "atr_a1_2" ["form_a1_2"]=> string(6) "atr_a1" }
Output for 7.3.32, 7.4.26
array(2) { ["form_a1"]=> string(8) "atr_a1_2" ["form_a1_2"]=> string(6) "atr_a1" }

preferences:
167.28 ms | 401 KiB | 180 Q