|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2010-02-22 13:04 UTC] c dot robin at smartphp dot org
  [2013-05-18 18:45 UTC] lukman135cc at Gmail dot com
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 10:00:02 2025 UTC | 
Description: ------------ There seems to be a problem with registering classes, which use the magic method __get(). If a method with this name is defined for a class, no method calls (to any method of this class) are possible within JS. PECL-Spidermonkey was build against spidermonkey-1.7.0 with threadsafe USE-Flag (which basically means make is called with JS_THREADSAFE=1) PHP 5.3.1 (the stable version was used, but it was not possible to select it in the above selectbox) was compiled with the following configure line: ./configure' '--prefix=/usr/lib64/php5' '--host=x86_64-pc- linux-gnu' '--mandir=/usr/lib64/php5/man' '-- infodir=/usr/lib64/php5/info' '--sysconfdir=/etc' '--cache- file=./config.cache' '--with-libdir=lib64' '--with-pcre- regex=/usr' '--enable-maintainer-zts' '--enable-cli' '-- disable-cgi' '--with-config-file-path=/etc/php/cli-php5' '-- with-config-file-scan-dir=/etc/php/cli-php5/ext-active' '-- without-pear' '--disable-bcmath' '--with-bz2' '--disable- calendar' '--without-curl' '--without-curlwrappers' '-- enable-exif' '--enable-ftp' '--with-gettext' '--with-gmp' '- -disable-hash' '--without-kerberos' '--enable-mbstring' '-- with-mcrypt' '--without-mhash' '--without-mssql' '--with- openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--with- pgsql' '--with-pspell' '--without-recode' '--disable-shmop' '--without-snmp' '--enable-soap' '--enable-sockets' '-- without-sybase-ct' '--enable-sysvmsg' '--enable-sysvsem' '-- enable-sysvshm' '--without-tidy' '--disable-wddx' '-- disable-xmlreader' '--disable-xmlwriter' '--with-xmlrpc' '-- with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '-- without-enchant' '--disable-intl' '--disable-phar' '-- enable-dba' '--without-cdb' '--with-db4' '--disable- flatfile' '--with-gdbm' '--disable-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--disable- gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '- -without-xpm-dir' '--with-gd' '--with-imap' '--with-imap- ssl' '--with-mysql=/usr' '--with-mysql- sock=/var/run/mysqld/mysqld.sock' '--with- mysqli=/usr/bin/mysql_config' '--without-pdo-dblib' '--with- pdo-mysql=/usr' '--without-pdo-odbc' '--with-pdo-pgsql' '-- with-pdo-sqlite=/usr' '--with-readline' '--without-libedit' '--without-mm' '--with-sqlite=/usr' '--enable-sqlite-utf8' If you need any further informations, give me a hint what you need, and I will try to provide it. Reproduce code: --------------- $ctx = new JSContext(); class Test { public function __get($key){ // Problem exists even if not used, it is enough if it is defined! // If you remove this method definition, everything works fine. } public function doSomething(){ echo "Foo!"; } } $ctx->registerClass("Test"); $ctx->evaluateScript("var m = new Test();m.doSomething();"); Expected result: ---------------- Should print "Foo!" Actual result: -------------- Instead the following Exception is thrown: PHP Fatal error: Uncaught exception 'Exception' with message 'TypeError: m.doSomething is not a function' in ..... If you delete the method definition for __get(), everything works fine, and the expected result is given.