3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ids = [1, 2, 'string']; array_filter($ids, function ($id) { $pass = is_numeric($id) && $id == (int) $id; assert($pass, $id . ' is not an integer'); return $pass; });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7dae2
function name:  (null)
number of ops:  7
compiled vars:  !0 = $ids
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7dae2%3A5%240'
    9     4        SEND_VAL                                                 ~2
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7dae2%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/7dae2
function name:  {closure}
number of ops:  17
compiled vars:  !0 = $id, !1 = $pass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'is_numeric'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4      > JMPZ_EX                                          ~3      $2, ->8
          5    >   CAST                                          4  ~4      !0
          6        IS_EQUAL                                         ~5      !0, ~4
          7        BOOL                                             ~3      ~5
          8    >   ASSIGN                                                   !1, ~3
    7     9        ASSERT_CHECK                                             
         10        INIT_FCALL                                               'assert'
         11        SEND_VAR                                                 !1
         12        CONCAT                                           ~7      !0, '+is+not+an+integer'
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                                 
    8    15      > RETURN                                                   !1
    9    16*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7dae2%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.51 ms | 1383 KiB | 19 Q