Bug #63025 [Opn]: Method in trait not called when called as __constructor() argument

From: Date: Sun, 09 Sep 2012 09:02:40 +0000
Subject: Bug #63025 [Opn]: Method in trait not called when called as __constructor() argument
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8838@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63025&edit=1 ID: 63025 Updated by: laruence@php.net Reported by: hinikato at mail dot ru Summary: Method in trait not called when called as __constructor() argument Status: Open Type: Bug Package: Documentation problem Operating System: Windows 7 x64 PHP Version: 5.4.6 Block user comment: N Private report: N New Comment: as felipe closed a similar one #54162. then I think this could also be closed see: http://news.php.net/php.bugs/173260 Previous Comments: ------------------------------------------------------------------------ [2012-09-09 06:14:36] hinikato at mail dot ru @reeze.xia, ok, fine ;) I agree, that the #54162 issue can be marked as duplicated, this issue contains more information. ------------------------------------------------------------------------ [2012-09-08 15:38:03] reeze dot xia at gmail dot com I found a same bug reported before: https://bugs.php.net/bug.php?id=54162 we could mark one of them as duplicated ------------------------------------------------------------------------ [2012-09-07 08:42:29] laruence@php.net s #if there is construct,#if there is no constructor,# ------------------------------------------------------------------------ [2012-09-07 08:41:41] laruence@php.net construct is a fcall after ZEND_NEW opcode, if there is construct, then no fcall at all(thus no argument substituation). <?php class Foo { } function a() { die("DIE ME!"); } $b = new Foo(a()); ?> I'd like to mark this as a DOC bug, since agrumets eval is useless in most of the times. ------------------------------------------------------------------------ [2012-09-07 07:14:19] reeze dot xia at gmail dot com hi hinikato, Yes, as previous email, if constructor was defined it will get called so your func_get_args() test script works :) . if not it will not get called, so the params expression will not executed. new operator is not the same as normal function call. so it behavior differently, ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=63025 -- Edit this bug report at https://bugs.php.net/bug.php?id=63025&edit=1

« previous php.doc.bugs (#8838) next »