3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("CLI", !isset($_SERVER['HTTP_USER_AGENT'])); $lt = (CLI) ? "\r\n" : "<br />"; /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude); public function applyWax($waxType){ echo("Ahh, all waxed up with '".$waxType."', ready to go!" . $lt); } public function paddleOut(){ echo("Paddling...." . $lt); } public function screamShark(){ echo("SHARK!!" . $lt); } } /** * RookieSurfer Class * * This surfer is green and can barely surf =) * @package hangten */ class RookieSurfer extends Surfer { public function rideWave($amplitude = 1){ echo("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!" . $lt); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { public function rideWave($amplitude = 8){ echo("Riding a ".$amplitude."ft. wave backwards doing a backflip!" . $lt); } public function killSharkWithBoard(){ echo("totally just sliced that shark in two, he's over it!! booya!" . $lt); } } // Rookie Instantiation $rookie = new RookieSurfer; $rookie->applyWax("Candle Wax"); $rookie->paddleOut(); $rookie->rideWave(2); $rookie->screamShark(); // Pro Instantiation $pro = new ProSurfer; $pro->applyWax("Sex Wax"); $pro->paddleOut(); $pro->rideWave(50); $pro->killSharkWithBoard();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  (null)
number of ops:  40
compiled vars:  !0 = $lt, !1 = $rookie, !2 = $pro
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'CLI'
          2        FETCH_IS                                         ~3      '_SERVER'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, 'HTTP_USER_AGENT'
          4        BOOL_NOT                                         ~5      ~4
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
    2     7        FETCH_CONSTANT                                   ~7      'CLI'
          8      > JMPZ                                                     ~7, ->11
          9    >   QM_ASSIGN                                        ~8      '%0D%0A'
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~8      '%3Cbr+%2F%3E'
         12    >   ASSIGN                                                   !0, ~8
   57    13        NEW                                              $10     'RookieSurfer'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $10
   58    16        INIT_METHOD_CALL                                         !1, 'applyWax'
         17        SEND_VAL_EX                                              'Candle+Wax'
         18        DO_FCALL                                      0          
   59    19        INIT_METHOD_CALL                                         !1, 'paddleOut'
         20        DO_FCALL                                      0          
   60    21        INIT_METHOD_CALL                                         !1, 'rideWave'
         22        SEND_VAL_EX                                              2
         23        DO_FCALL                                      0          
   61    24        INIT_METHOD_CALL                                         !1, 'screamShark'
         25        DO_FCALL                                      0          
   64    26        NEW                                              $17     'ProSurfer'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !2, $17
   65    29        INIT_METHOD_CALL                                         !2, 'applyWax'
         30        SEND_VAL_EX                                              'Sex+Wax'
         31        DO_FCALL                                      0          
   66    32        INIT_METHOD_CALL                                         !2, 'paddleOut'
         33        DO_FCALL                                      0          
   67    34        INIT_METHOD_CALL                                         !2, 'rideWave'
         35        SEND_VAL_EX                                              50
         36        DO_FCALL                                      0          
   68    37        INIT_METHOD_CALL                                         !2, 'killSharkWithBoard'
         38        DO_FCALL                                      0          
         39      > RETURN                                                   1

Class Surfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  rideWave
number of ops:  2
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function ridewave

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  applyWax
number of ops:  6
compiled vars:  !0 = $waxType, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        CONCAT                                           ~2      'Ahh%2C+all+waxed+up+with+%27', !0
          2        CONCAT                                           ~3      ~2, '%27%2C+ready+to+go%21'
          3        CONCAT                                           ~4      ~3, !1
          4        ECHO                                                     ~4
   15     5      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  paddleOut
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   CONCAT                                           ~1      'Paddling....', !0
          1        ECHO                                                     ~1
   19     2      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  screamShark
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   CONCAT                                           ~1      'SHARK%21%21', !0
          1        ECHO                                                     ~1
   23     2      > RETURN                                                   null

End of function screamshark

End of class Surfer.

Class RookieSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  rideWave
number of ops:  6
compiled vars:  !0 = $amplitude, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV_INIT                                        !0      1
   35     1        CONCAT                                           ~2      'Trying..+Trying..+to+ride+a+', !0
          2        CONCAT                                           ~3      ~2, 'ft.+wave%2C+whew%21'
          3        CONCAT                                           ~4      ~3, !1
          4        ECHO                                                     ~4
   36     5      > RETURN                                                   null

End of function ridewave

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  applyWax
number of ops:  6
compiled vars:  !0 = $waxType, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        CONCAT                                           ~2      'Ahh%2C+all+waxed+up+with+%27', !0
          2        CONCAT                                           ~3      ~2, '%27%2C+ready+to+go%21'
          3        CONCAT                                           ~4      ~3, !1
          4        ECHO                                                     ~4
   15     5      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  paddleOut
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   CONCAT                                           ~1      'Paddling....', !0
          1        ECHO                                                     ~1
   19     2      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  screamShark
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   CONCAT                                           ~1      'SHARK%21%21', !0
          1        ECHO                                                     ~1
   23     2      > RETURN                                                   null

End of function screamshark

End of class RookieSurfer.

Class ProSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  rideWave
number of ops:  6
compiled vars:  !0 = $amplitude, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV_INIT                                        !0      8
   48     1        CONCAT                                           ~2      'Riding+a+', !0
          2        CONCAT                                           ~3      ~2, 'ft.+wave+backwards+doing+a+backflip%21'
          3        CONCAT                                           ~4      ~3, !1
          4        ECHO                                                     ~4
   49     5      > RETURN                                                   null

End of function ridewave

Function killsharkwithboard:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  killSharkWithBoard
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   CONCAT                                           ~1      'totally+just+sliced+that+shark+in+two%2C+he%27s+over+it%21%21+booya%21', !0
          1        ECHO                                                     ~1
   53     2      > RETURN                                                   null

End of function killsharkwithboard

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  applyWax
number of ops:  6
compiled vars:  !0 = $waxType, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        CONCAT                                           ~2      'Ahh%2C+all+waxed+up+with+%27', !0
          2        CONCAT                                           ~3      ~2, '%27%2C+ready+to+go%21'
          3        CONCAT                                           ~4      ~3, !1
          4        ECHO                                                     ~4
   15     5      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  paddleOut
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   CONCAT                                           ~1      'Paddling....', !0
          1        ECHO                                                     ~1
   19     2      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NkfbA
function name:  screamShark
number of ops:  3
compiled vars:  !0 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   CONCAT                                           ~1      'SHARK%21%21', !0
          1        ECHO                                                     ~1
   23     2      > RETURN                                                   null

End of function screamshark

End of class ProSurfer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.39 ms | 1408 KiB | 15 Q