internals2-php-opcodes-php-declare-class-5

  • Opcode Descriptions and
    Examples
  • DECLARE_CLASS

  • DECLARE_CLASS
  • DECLARE_CLASS

    DECLARE_CLASS

    PHP code

    <?php
    /*
     * Declare a class with the name of class-name as the implementation specified by ID.
     * opcode number: 139
     */
    class {
        function 
    methodA(){
            echo 
    "hello world";
        }
    }
    ?>

    PHP opcodes

    Function name: (null)

    Compiled variables: none

    line # op fetch ext return operands
    6 0 NOP        
    11 1 RETURN       1

    Function name: methodA

    Compiled variables: none

    line # op fetch ext return operands
    8 0 ECHO       ‘hello+world’
    9 1 RETURN       null