Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

Fatal error:: Cannot use 'PhpParser\Node\Expr\Cast\Bool' as class name as it is reserved #32

Open
ganeshkbhat opened this issue Mar 25, 2016 · 5 comments

Comments

@ganeshkbhat
Copy link

When compiling I am getting this error when converting:

Fatal error: Cannot use 'PhpParser\Node\Expr\Cast\Bool' as class name as it is reserved in C:\Users\ganes\Downloads\php\php-to-c\php-to-c-extension\vendor\fezfez\php-to-zephir\src\PhpToZephir\Converter\Printer\Expr\Cast\BoolPrinter.php on line 16

I am working with arrays and using unset function. Its a simple iterator

@fezfez
Copy link
Owner

fezfez commented Mar 25, 2016

Can you run the convertion with --debug and identify the code ?

@ganeshkbhat
Copy link
Author

Fez, thats the error when I am running the --debug option as well. The command is this:

php bin/php-to-zephir.php phpToZephir:convert --debug C:\Users\ganes\Downloads\php\sample

@ganeshkbhat
Copy link
Author

I must say I am on Windows 10. now i am getting the this error:

php vendor/bin/php-to-zephir phpToZephir:convert C:\Users\ganes\Downloads\php\sample\

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../fezfez/php-to-zephir/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/php-to-zephir" "$@"

@ganeshkbhat
Copy link
Author

i presume it was a bat file so the issue. i was using the command php vendor/bin/php-to-zipher.bat it breaks. if I use the path php vendor\fezfez\php-to-zephir\bin\php-to-zipher the compilation to zipher occurs correctly. i cannot run the .bat file directly though says not correct path. please check the bat file for path definition issues

@ganeshkbhat
Copy link
Author

Not sure what I did. I set up the environment for Zephir and now the php vendor\fezfez\php-to-zephir\bin\php-to-zipher command also does not compile to zipher. I am able to compile .zep files to an complete .dll and .so. I am on Windows 10, PHP 7.0.4 TS X64, Apache 2.4. I have attached my environment variables and the errors.

env variables
php2zipher

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants