Skip to content

fix: propagate return value modifications #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pdelewski
Copy link
Member

@pdelewski pdelewski commented Nov 17, 2022

Without additional echo call in helloWorld, code for main looks as follows
$_main: ; (lines=4, args=0, vars=0, tmps=1) ; (after optimizer) ; /Users/pdelewski/Projects/php-auto/test3.php:1-8 0000 INIT_FCALL 1 112 string("var_dump") 0001 SEND_VAL int(1) 1 0002 DO_ICALL 0003 RETURN int(1)

which means that call to helloWorld has been optimized out and in result hooks are not invoked

@pdelewski pdelewski force-pushed the multiple-hooks-modify-returnvalue branch 2 times, most recently from ca0974c to 63af860 Compare November 17, 2022 16:33
@brettmc
Copy link
Collaborator

brettmc commented Nov 19, 2022

It seems like whether a call is optimized away is out of our control, so do we need a warning in the documentation about this? Is there a good guide already in existence on when this might happen, that we could link to?

@pdelewski
Copy link
Member Author

It seems like whether a call is optimized away is out of our control, so do we need a warning in the documentation about this? Is there a good guide already in existence on when this might happen, that we could link to?

Don't know about guide. Will try to figure out whether observer api can do something about it.

@brettmc
Copy link
Collaborator

brettmc commented Nov 22, 2022

@pdelewski I think it's ok for now to just add a one-line warning to the usage section of readme, then I'll merge it.

@pdelewski pdelewski force-pushed the multiple-hooks-modify-returnvalue branch 3 times, most recently from 6b35254 to 02452e0 Compare November 23, 2022 07:44
@pdelewski pdelewski force-pushed the multiple-hooks-modify-returnvalue branch from 02452e0 to e0ad9d5 Compare November 23, 2022 07:46
@pdelewski
Copy link
Member Author

pdelewski commented Nov 23, 2022

@pdelewski I think it's ok for now to just add a one-line warning to the usage section of readme, then I'll merge it.

@brettmc ok, done.

@brettmc brettmc merged commit 763de42 into open-telemetry:main Nov 23, 2022
LionsAd pushed a commit to LionsAd/opentelemetry-php-instrumentation that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants