3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Pont { private string $unite = 'm²'; private float $longueur; private float $largeur; public function setLongueur(float $longueur): void { if ($longueur < 0) { trigger_error( 'La longueur est trop courte. (min 1)', E_USER_ERROR ); } $this->longueur = $longueur; } } $towerBridge = new Pont; $towerBridge->setLongueur(286.0); $towerBridge->setLongueur(-286.0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDc4k
function name:  (null)
number of ops:  10
compiled vars:  !0 = $towerBridge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Pont'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'setLongueur'
          4        SEND_VAL_EX                                              286
          5        DO_FCALL                                      0          
   27     6        INIT_METHOD_CALL                                         !0, 'setLongueur'
          7        SEND_VAL_EX                                              -286
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Pont:
Function setlongueur:
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 = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/DDc4k
function name:  setLongueur
number of ops:  10
compiled vars:  !0 = $longueur
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   14     1        IS_SMALLER                                               !0, 0
          2      > JMPZ                                                     ~1, ->7
   15     3    >   INIT_FCALL                                               'trigger_error'
   16     4        SEND_VAL                                                 'La+longueur+est+trop+courte.+%28min+1%29'
   17     5        SEND_VAL                                                 256
   15     6        DO_ICALL                                                 
   21     7    >   ASSIGN_OBJ                                               'longueur'
          8        OP_DATA                                                  !0
   22     9      > RETURN                                                   null

End of function setlongueur

End of class Pont.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.38 ms | 1451 KiB | 14 Q