# Slim 3.3 truncates output

**URL:** https://discourse.slimframework.com/t/slim-3-3-truncates-output/111
**Category:** Questions
**Created:** [April 12, 2016, 8:13am UTC](https://discourse.slimframework.com/t/slim-3-3-truncates-output/111 "2016-04-12T08:13:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sdoll](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sdoll](https://discourse.slimframework.com/u/sdoll)
#### Post date: [April 12, 2016, 8:13am UTC](https://discourse.slimframework.com/t/slim-3-3-truncates-output/111/1 "2016-04-12T08:13:44Z")

</div>

I’m trying to get Slim to run on my Windows 7 system.  
So far I’ve gotten everything installed with Composer but when I run a very simple program, the output is not as intended.

Below is my code:

\<?php ini\_set('display\_errors', 1); ini\_set('display\_startup\_errors', 1); error\_reporting(E\_ALL); use Slim\App; use Slim\Http\Request; use Slim\Http\Response; require '../vendor/autoload.php'; $app = new App; $app-\>get('/', function (Request $in, Response $out, $args) { return $out-\>write("xxxxx"); }); $app-\>run(); I am expecting output "xxxxx", instead i get "x". This means I loose 4 characters somewhere. Running PHP 5.5.12 The encoding is UTF-8 (not BOM) When i run "curl -v http://localhost:8080/" I get D:\wamp\www\slim\_test\src\public\>curl -v http://localhost:8080/ \* Trying 127.0.0.1... \* Connected to localhost (127.0.0.1) port 8080 (#0) \> GET / HTTP/1.1 \> Host: localhost:8080 \> User-Agent: curl/7.46.0 \> Accept: \*/\* \> \< HTTP/1.1 200 OK \< Host: localhost:8080 \< Connection: close \< X-Powered-By: PHP/5.5.12 \< Content-Type: text/html; charset=UTF-8 \< Content-Length: 5 \< x\* Closing connection 0 I'd appreciate your help. EDIT Once i append these lines of code to the end of the file, the response is correct. $response = $app-\>run(true); //Silent mode, wont send the response $response = $response-\>withoutHeader("Content-Length"); //Remove the Content-Length $app-\>respond($response); //Now we send the response I cannot figure out why.....?

---

<div class="post-metadata">

### Author: ![llvdl](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/llvdl/32/78_2.png) [@llvdl](https://discourse.slimframework.com/u/llvdl)
#### Post date: [May 1, 2016, 10:34pm UTC](https://discourse.slimframework.com/t/slim-3-3-truncates-output/111/2 "2016-05-01T22:34:06Z")

</div>

I get “xxxxx” on my machine. Is there any whitespace before the `<?php` tag?

---

<div class="post-metadata">

### Author: ![sdoll](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@sdoll](https://discourse.slimframework.com/u/sdoll)
#### Post date: [May 2, 2016, 8:30am UTC](https://discourse.slimframework.com/t/slim-3-3-truncates-output/111/3 "2016-05-02T08:30:30Z")

</div>

Hi llvdl,

I already implemented a workaround for this issue.  
After your comment I went back over my problem code…I found 2 extra lines above my \<?php tag…  
After removing them it worked as intended.  
Thank you so much for even looking at this thread after so long.  
Have a great week!
