Skip to content

Instantly share code, notes, and snippets.

@mattparker
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattparker/7aa406e411d89327df9b to your computer and use it in GitHub Desktop.
Save mattparker/7aa406e411d89327df9b to your computer and use it in GitHub Desktop.
Using breakpoints to trigger deprecated errors
<?php
error_reporting(E_ALL);
$host = 'mongodb://127.0.0.1/test';
echo "\n Testing deprecated MongoClient::connected property \n";
$client1 = new \MongoClient($host);
echo "done"; // breakpoint on this line triggers deprecation notice
Log opened at 2014-09-22 11:09:01
I: Connecting to configured address/port: 127.0.0.1:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///root/Command line code" language="PHP" protocol_version="1.0" appid="9602"><engine version="2.2.3"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2013 by Derick Rethans]]></copyright></init>
<- feature_set -i 0 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"></response>
<- feature_set -i 1 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>
<- feature_set -i 2 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>
<- status -i 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="3" status="starting" reason="ok"></response>
<- step_into -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="4" status="stopping" reason="ok"></response>
<- eval -i 5 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="5"><error code="5"><message><![CDATA[command is not available]]></message></error></response>
Log closed at 2014-09-22 11:09:01
<- context_get -i 24 -d 0 -c 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="24" context="0"><property name="$client1" fullname="$client1" address="140374036897232" type="object" classname="MongoClient" children="1" numchildren="4" page="0" pagesize="100"><property name="connected" fullname="$client1-&gt;connected" facet="public" address="39195904" type="bool"><![CDATA[1]]></property><property name="status" fullname="$client1-&gt;status" facet="public" address="39196272" type="null"></property><property name="server" fullname="$client1-&gt;server" facet="protected" address="39196496" type="null"></property><property name="persistent" fullname="$client1-&gt;persistent" facet="protected" address="39196720" type="null"></property></property><property name="$host" fullname="$host" address="140374036897184" type="string" size="24" encoding="base64"><![CDATA[bW9uZ29kYjovLzEyNy4wLjAuMS90ZXN0]]></property></response>
@mattparker
Copy link
Author

(The second xdebug log just shows the line that gets the connected property. There's lots more).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment