php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59055 bcompiler can't parse abstract classes
Submitted: 2010-02-01 11:07 UTC Modified: 2010-02-01 15:02 UTC
From: bugs at bilke dot org Assigned:
Status: Wont fix Package: bcompiler (PECL)
PHP Version: 5.2.10 OS: Ubuntu 9.10
Private report: No CVE-ID: None
 [2010-02-01 11:07 UTC] bugs at bilke dot org
Description:
------------
I use the bcompiler_compile.php script which is available in the bcompiler documentation. With this script it's not possible to combile an abstract class.

The compilation of this code below will fail with an error.

Reproduce code:
---------------
<?php
abstract class MyClass {
abstract public function myFunc();
}
?>

Actual result:
--------------
Fatal error: Class MyClass contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyClass::myFunc) in /usr/share/php/PEAR/bcompiler/examples/bcompiler_compile.php(168) : eval()'d code on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-01 15:02 UTC] val@php.net
bcompiler_compile.php become outdated with the recent development of the extension. I'll remove it from the repository. Would suggest using a simpler compile script, like:

<php
function compile($sname, $tname = '') {
  if ($tname == '') $tname = preg_replace("!\.php!", ".phb", $sname);
  echo " * source file: $sname\n * target file: $tname\n";
  ob_end_flush();
  $f = fopen($tname, "w");
  bcompiler_write_header($f);
  bcompiler_write_file($f, $sname);
  bcompiler_write_footer($f);
  fclose($f);
  echo " > compiled\n";
}

for ($i = 1; $i < $_SERVER['argc']; $i++) {
  $sname = $_SERVER['argv'][$i];
  compile($sname, '');
}
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 00:01:27 2024 UTC