3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = 'mickmackusa'; $yob = fn(?int $age): ?int => !$age ? null : ( fn($birthYear) => (print "$name's birth year is $birthYear\n") ? $birthYear : null )(date('Y') - $age); var_export($yob(null)); echo "\n---\n"; var_export($yob(31));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0pj8D
function name:  (null)
number of ops:  19
compiled vars:  !0 = $name, !1 = $yob, !2 = $birthYear
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'mickmackusa'
    5     1        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          2        BIND_LEXICAL                                             ~4, !0
          3        BIND_LEXICAL                                             ~4, !2
          4        ASSIGN                                                   !1, ~4
   11     5        INIT_FCALL                                               'var_export'
          6        INIT_DYNAMIC_CALL                                        !1
          7        SEND_VAL_EX                                              null
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   12    11        ECHO                                                     '%0A---%0A'
   13    12        INIT_FCALL                                               'var_export'
         13        INIT_DYNAMIC_CALL                                        !1
         14        SEND_VAL_EX                                              31
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        DO_ICALL                                                 
         18      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0pj8D
function name:  {closure}
number of ops:  21
compiled vars:  !0 = $age, !1 = $name, !2 = $birthYear
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
          3        BOOL_NOT                                         ~3      !0
          4      > JMPZ                                                     ~3, ->7
    6     5    >   QM_ASSIGN                                        ~4      null
          6      > JMP                                                      ->17
    8     7    >   DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          8        BIND_LEXICAL                                             ~5, !1
    9     9        INIT_DYNAMIC_CALL                                        ~5
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Y'
         12        DO_ICALL                                         $6      
         13        SUB                                              ~7      $6, !0
         14        SEND_VAL_EX                                              ~7
         15        DO_FCALL                                      0  $8      
         16        QM_ASSIGN                                        ~4      $8
         17    >   VERIFY_RETURN_TYPE                                       ~4
         18      > RETURN                                                   ~4
         19*       VERIFY_RETURN_TYPE                                       
         20*     > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0pj8D
function name:  {closure}
number of ops:  13
compiled vars:  !0 = $birthYear, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        ROPE_INIT                                     4  ~3      !1
          3        ROPE_ADD                                      1  ~3      ~3, '%27s+birth+year+is+'
          4        ROPE_ADD                                      2  ~3      ~3, !0
          5        ROPE_END                                      3  ~2      ~3, '%0A'
          6        ECHO                                                     ~2
          7      > JMPZ                                                     1, ->10
          8    >   QM_ASSIGN                                        ~5      !0
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~5      null
         11    > > RETURN                                                   ~5
    9    12*     > RETURN                                                   null

End of Dynamic Function 0

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.06 ms | 1004 KiB | 15 Q