略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: RAISE_ABSTRACT_ERROR

2024-12-25

RAISE_ABSTRACT_ERROR

PHP code

<?php
/*
 * 
 * opcode number: 142
 */

abstract class fail {
    abstract function 
show();
}

class 
pass extends fail {
    function 
show() {
        echo 
"Call to function show()\n";
    }
}

$t2 = new pass();
$t2->show();

$t = new fail();
$t->show();

echo 
"Done\n"// shouldn't be displayed
?>

PHP opcodes

Function name: (null)

Compiled variables: !0=$t2, !1=$t

line#op fetchextreturn operands
70 NOP      
111 NOP      
 2 NOP      
173 ZEND_FETCH_CLASS   :3 'pass'
 4 NEW   $4 :3
 5 DO_FCALL_BY_NAME  0   
 6 ASSIGN     !0,$4
187 ZEND_INIT_METHOD_CALL     !0,'show'
 8 DO_FCALL_BY_NAME  0   
209 ZEND_FETCH_CLASS   :9 'fail'
 10 NEW   $10 :9
 11 DO_FCALL_BY_NAME  0   
 12 ASSIGN     !1,$10
2113 ZEND_INIT_METHOD_CALL     !1,'show'
 14 DO_FCALL_BY_NAME  0   
2315 ECHO     'Done%0A'
2416 RETURN     1

Function name: show

Compiled variables: none

line#op fetchextreturn operands
80 ZEND_RAISE_ABSTRACT_ERROR      
 1 RETURN     null

Function name: show

Compiled variables: none

line#op fetchextreturn operands
130 ECHO     'Call+to+function+show%28%29%0A'
141 RETURN     null
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/internals2.opcodes.raise-abstract-error.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3