3v4l.org

run code in 300+ PHP versions simultaneously
<?php class QueroBatataException extends UnexpectedValueException { } class QueroCebolaException extends UnexpectedValueException { } function batata($nomeLegume) { if ($nomeLegume !== 'batata') { throw new QueroBatataException('Me dê batata'); } echo 'Huuun Batata!' . PHP_EOL; } function cebola($nomeLegume) { if ($nomeLegume !== 'cebola') { throw new QueroCebolaException('Me dê cebola'); } echo 'Huuun Cebola!' . PHP_EOL; } $legume = 'batata'; try { batata($legume); cebola($legume); } catch (UnexpectedValueException $e) { echo $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K2ek7
function name:  (null)
number of ops:  13
compiled vars:  !0 = $legume, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   ASSIGN                                                   !0, 'batata'
   28     1        INIT_FCALL                                               'batata'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   29     4        INIT_FCALL                                               'cebola'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0          
          7      > JMP                                                      ->12
   30     8  E > > CATCH                                       last         'UnexpectedValueException'
   31     9    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
   32    12    > > RETURN                                                   1

Function batata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K2ek7
function name:  batata
number of ops:  9
compiled vars:  !0 = $nomeLegume
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        IS_NOT_IDENTICAL                                         !0, 'batata'
          2      > JMPZ                                                     ~1, ->7
   10     3    >   NEW                                              $2      'QueroBatataException'
          4        SEND_VAL_EX                                              'Me+d%C3%AA+batata'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   13     7    >   ECHO                                                     'Huuun+Batata%21%0A'
   14     8      > RETURN                                                   null

End of function batata

Function cebola:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K2ek7
function name:  cebola
number of ops:  9
compiled vars:  !0 = $nomeLegume
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        IS_NOT_IDENTICAL                                         !0, 'cebola'
          2      > JMPZ                                                     ~1, ->7
   19     3    >   NEW                                              $2      'QueroCebolaException'
          4        SEND_VAL_EX                                              'Me+d%C3%AA+cebola'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   22     7    >   ECHO                                                     'Huuun+Cebola%21%0A'
   23     8      > RETURN                                                   null

End of function cebola

Class QueroBatataException: [no user functions]
Class QueroCebolaException: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.43 ms | 1442 KiB | 15 Q